Search in sources :

Example 1 with HostsXmlProvisioner

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());
}
Also used : HostsXmlProvisioner(com.yahoo.config.model.provision.HostsXmlProvisioner) NullConfigModelRegistry(com.yahoo.config.model.NullConfigModelRegistry) DeployState(com.yahoo.config.model.deploy.DeployState) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) VespaModel(com.yahoo.vespa.model.VespaModel) StringReader(java.io.StringReader) FilesApplicationPackage(com.yahoo.config.model.application.provider.FilesApplicationPackage) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) Test(org.junit.Test)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 HostsXmlProvisioner (com.yahoo.config.model.provision.HostsXmlProvisioner)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 StringReader (java.io.StringReader)1 Test (org.junit.Test)1