use of org.jdom2.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 org.jdom2.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 org.jdom2.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 org.jdom2.Document in project gocd by gocd.
the class DirectoryEntriesTest method shouldReturnAMessageWhenThereAreNoArtifacts.
@Test
public void shouldReturnAMessageWhenThereAreNoArtifacts() throws Exception {
HtmlRenderer renderer = new HtmlRenderer("context");
DirectoryEntries directoryEntries = new DirectoryEntries();
directoryEntries.add(new FolderDirectoryEntry("cruise-output", "", new DirectoryEntries()));
directoryEntries.setIsArtifactsDeleted(true);
directoryEntries.render(renderer);
Element document = getRenderedDocument(renderer);
assertThat(document.getChildren().size(), is(2));
assertThat(document.getChild("p").getTextNormalize(), Matchers.containsString("Artifacts for this job instance are unavailable as they may have been or deleted externally. Re-run the stage or job to generate them again."));
assertThat(document.getChild("ul").getChild("div").getChild("span").getChild("a").getTextNormalize(), is("cruise-output"));
}
use of org.jdom2.Document in project gocd by gocd.
the class DirectoryEntriesTest method shouldReturnAMessageWhenAllArtifactsHaveBeenDeletedButArtifactsDeletedFlagHasNotBeenSet.
@Test
public void shouldReturnAMessageWhenAllArtifactsHaveBeenDeletedButArtifactsDeletedFlagHasNotBeenSet() throws Exception {
HtmlRenderer renderer = new HtmlRenderer("context");
DirectoryEntries directoryEntries = new DirectoryEntries();
directoryEntries.render(renderer);
Element document = getRenderedDocument(renderer);
assertThat(document.getChildren().size(), is(1));
assertThat(document.getChild("p").getTextNormalize(), Matchers.containsString("Artifacts for this job instance are unavailable as they may have been or deleted externally. Re-run the stage or job to generate them again."));
}
Aggregations