use of com.thoughtworks.go.server.presentation.models.HtmlRenderer 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 com.thoughtworks.go.server.presentation.models.HtmlRenderer 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."));
}
use of com.thoughtworks.go.server.presentation.models.HtmlRenderer in project gocd by gocd.
the class DirectoryEntriesTest method shouldListAllArtifactsWhenArtifactsNotPurged.
@Test
public void shouldListAllArtifactsWhenArtifactsNotPurged() throws Exception {
HtmlRenderer renderer = new HtmlRenderer("context");
DirectoryEntries directoryEntries = new DirectoryEntries();
directoryEntries.add(new FolderDirectoryEntry("cruise-output", "", new DirectoryEntries()));
directoryEntries.add(new FolderDirectoryEntry("some-artifact", "", new DirectoryEntries()));
directoryEntries.render(renderer);
Element document = getRenderedDocument(renderer);
assertThat(document.getChildren().size(), is(2));
Element cruiseOutputElement = (Element) document.getChildren().get(0);
assertThat(cruiseOutputElement.getChild("div").getChild("span").getChild("a").getTextNormalize(), is("cruise-output"));
Element artifactElement = (Element) document.getChildren().get(1);
assertThat(artifactElement.getChild("div").getChild("span").getChild("a").getTextNormalize(), is("some-artifact"));
}
use of com.thoughtworks.go.server.presentation.models.HtmlRenderer in project gocd by gocd.
the class ArtifactFolder method renderArtifactFiles.
public String renderArtifactFiles(String requestContext) {
HtmlRenderer renderer = new HtmlRenderer(requestContext);
allEntries().render(renderer);
return renderer.asString();
}
use of com.thoughtworks.go.server.presentation.models.HtmlRenderer in project gocd by gocd.
the class DirectoryEntriesTest method shouldReturnAMessageWhenAllArtifactsArePurgedIncludingCruiseOutput.
@Test
public void shouldReturnAMessageWhenAllArtifactsArePurgedIncludingCruiseOutput() throws Exception {
HtmlRenderer renderer = new HtmlRenderer("context");
DirectoryEntries directoryEntries = new DirectoryEntries();
directoryEntries.setIsArtifactsDeleted(true);
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