use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class XmlUtils method buildXmlDocument.
private static Document buildXmlDocument(InputStream inputStream, SAXBuilder builder) throws JDOMException, IOException {
XsdErrorTranslator errorHandler = new XsdErrorTranslator();
builder.setErrorHandler(errorHandler);
Document cruiseRoot = builder.build(inputStream);
if (errorHandler.hasValidationError()) {
throw new XsdValidationException(errorHandler.translate());
}
return cruiseRoot;
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class FullConfigSaveMergeFlowTest method setup.
@Before
public void setup() throws Exception {
configForEdit = mock(CruiseConfig.class);
updateConfigCommand = new FullConfigUpdateCommand(configForEdit, "md5");
loader = mock(MagicalGoConfigXmlLoader.class);
writer = mock(MagicalGoConfigXmlWriter.class);
document = mock(Document.class);
systemEnvironment = mock(SystemEnvironment.class);
fileWriter = mock(GoConfigFileWriter.class);
serverVersion = mock(ServerVersion.class);
timeProvider = mock(TimeProvider.class);
configRepository = mock(ConfigRepository.class);
cachedGoPartials = mock(CachedGoPartials.class);
configElementImplementationRegistry = mock(ConfigElementImplementationRegistry.class);
partials = new ArrayList<>();
flow = new FullConfigSaveMergeFlow(loader, writer, configElementImplementationRegistry, serverVersion, timeProvider, configRepository, cachedGoPartials, fileWriter);
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class FullConfigSaveNormalFlowTest method setup.
@Before
public void setup() throws Exception {
configForEdit = new BasicCruiseConfig();
updateConfigCommand = new FullConfigUpdateCommand(configForEdit, "md5");
loader = mock(MagicalGoConfigXmlLoader.class);
writer = mock(MagicalGoConfigXmlWriter.class);
document = mock(Document.class);
systemEnvironment = mock(SystemEnvironment.class);
fileWriter = mock(GoConfigFileWriter.class);
serverVersion = mock(ServerVersion.class);
timeProvider = mock(TimeProvider.class);
configRepository = mock(ConfigRepository.class);
cachedGoPartials = mock(CachedGoPartials.class);
configElementImplementationRegistry = mock(ConfigElementImplementationRegistry.class);
partials = new ArrayList<>();
flow = new FullConfigSaveNormalFlow(loader, writer, configElementImplementationRegistry, serverVersion, timeProvider, configRepository, cachedGoPartials, fileWriter);
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class HgModificationSplitter method modifications.
public List<Modification> modifications() {
try {
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(new StringReader(output));
return parseDOMTree(document);
} catch (Exception e) {
throw ExceptionUtils.bomb("Unable to parse hg log output: " + result.replaceSecretInfo(output), result.smudgedException(e));
}
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class MagicalGoConfigXmlLoader method fromXmlPartial.
public <T> T fromXmlPartial(InputStream inputStream, Class<T> o) throws Exception {
Document document = new SAXBuilder().build(inputStream);
Element element = document.getRootElement();
return classParser(element, o, configCache, new GoCipher(), registry, new ConfigReferenceElements()).parse();
}
Aggregations