use of com.zhan_dui.utils.m3u8.Element in project gocd by gocd.
the class BuildLogElement method setBuildLogHeader.
public Element setBuildLogHeader(String execCommand) {
Element target = new Element("target");
target.setAttribute("name", "exec");
build.addContent(target);
buildTask = new Element("task");
buildTask.setAttribute("name", execCommand);
target.addContent(buildTask);
return buildTask;
}
use of com.zhan_dui.utils.m3u8.Element in project gocd by gocd.
the class StageCctrayPresentationModelTest method shouldContainBuilds.
private void shouldContainBuilds(Element root) {
Element buildProject = findChildByName(root, "cruise :: ft :: firefox");
assertThat(buildProject, hasAttribute("activity", "Sleeping"));
assertThat(buildProject, hasAttribute("lastBuildStatus", "Success"));
assertThat(buildProject, hasAttribute("lastBuildLabel", String.valueOf(LABEL)));
assertThat(buildProject, hasAttribute("lastBuildTime", DATE_STR));
assertThat(buildProject, hasAttribute("webUrl", buildDetailUrl()));
}
use of com.zhan_dui.utils.m3u8.Element in project gocd by gocd.
the class StageCctrayPresentationModelTest method shouldGetGoodCctrayXml.
@Test
public void shouldGetGoodCctrayXml() throws Exception {
Element root = new Element("Projects");
cctrayXmlPresenter.toCctrayXml(root, CONTEXT_PATH);
assertThat(root.getChildren().size(), is(2));
shouldContainStage(root);
shouldContainBuilds(root);
}
use of com.zhan_dui.utils.m3u8.Element in project gocd by gocd.
the class GoConfigMigration method getCurrentSchemaVersion.
private int getCurrentSchemaVersion(String content) {
try {
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(new ByteArrayInputStream(content.getBytes()));
Element root = document.getRootElement();
String currentVersion = root.getAttributeValue(schemaVersion) == null ? "0" : root.getAttributeValue(schemaVersion);
return Integer.parseInt(currentVersion);
} catch (Exception e) {
throw bomb(e);
}
}
use of com.zhan_dui.utils.m3u8.Element in project gocd by gocd.
the class MagicalGoConfigXmlLoader method deserializeConfig.
public CruiseConfig deserializeConfig(String content) throws Exception {
String md5 = CachedDigestUtils.md5Hex(content);
Element element = parseInputStream(new ByteArrayInputStream(content.getBytes()));
LOGGER.debug("[Config Save] Updating config cache with new XML");
CruiseConfig configForEdit = classParser(element, BasicCruiseConfig.class, configCache, new GoCipher(), registry, new ConfigReferenceElements()).parse();
setMd5(configForEdit, md5);
configForEdit.setOrigins(new FileConfigOrigin());
return configForEdit;
}
Aggregations