use of com.yahoo.config.model.provision.HostsXmlProvisioner in project vespa by vespa-engine.
the class VespaModelTestCase method testDeployLogger.
@Test
public void testDeployLogger() throws IOException, SAXException {
final String services = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "<services version=\"1.0\">" + "<config name=\"unknsownfoo\">" + "<logserver><host>foo</host></logserver>" + "</config>" + "<admin version=\"2.0\">" + " <adminserver hostalias=\"node0\" />" + "</admin>" + "</services>";
MyLogger logger = new MyLogger();
final DeployState.Builder builder = new DeployState.Builder();
builder.modelHostProvisioner(new HostsXmlProvisioner(new StringReader(simpleHosts)));
ApplicationPackage app = new MockApplicationPackage.Builder().withHosts(simpleHosts).withServices(services).build();
DeployState deployState = builder.deployLogger(logger).applicationPackage(app).build(true);
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
Validation.validate(model, true, deployState);
assertFalse(logger.msgs.isEmpty());
}
Aggregations