use of com.yahoo.config.model.NullConfigModelRegistry in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_with_no_handlers_passes_validation_without_write_protection.
@Test
public void cluster_with_no_handlers_passes_validation_without_write_protection() throws IOException, SAXException {
DeployState deployState = deployState(servicesXml(false, false));
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.NullConfigModelRegistry in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_with_write_protection_passes_validation.
@Test
public void cluster_with_write_protection_passes_validation() throws IOException, SAXException {
DeployState deployState = deployState(servicesXml(true, true));
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.NullConfigModelRegistry in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_without_custom_components_passes_validation_without_write_protection.
@Test
public void cluster_without_custom_components_passes_validation_without_write_protection() throws IOException, SAXException {
String servicesXml = joinLines("<services version='1.0'>", " <container id='default' version='1.0' />", "</services>");
DeployState deployState = deployState(servicesXml);
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.NullConfigModelRegistry in project vespa by vespa-engine.
the class AccessControlValidatorTest method write_protection_is_not_required_for_non_default_application_type.
@Test
public void write_protection_is_not_required_for_non_default_application_type() throws IOException, SAXException {
String servicesXml = joinLines("<services version='1.0' application-type='hosted-infrastructure'>", " <container id='default' version='1.0'>", httpHandlerXml, " </container>", "</services>");
DeployState deployState = deployState(servicesXml);
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.NullConfigModelRegistry in project vespa by vespa-engine.
the class ContainerModelBuilderTest method qrconfig_is_produced.
@Test
public void qrconfig_is_produced() throws IOException, SAXException {
String servicesXml = "<services>" + "<admin version='3.0'>" + " <nodes count='1'/>" + "</admin>" + "<jdisc id ='default' version='1.0'>" + " <nodes>" + " <node hostalias='node1' />" + " </nodes>" + "</jdisc>" + "</services>";
ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices(servicesXml).build();
VespaModel model = new VespaModel(new NullConfigModelRegistry(), new DeployState.Builder().applicationPackage(applicationPackage).properties(new DeployProperties.Builder().build()).build(true));
// Using the same way of getting hostname as filedistribution model
String hostname = HostName.getLocalhost();
QrConfig config = model.getConfig(QrConfig.class, "default/container.0");
assertEquals("default.container.0", config.discriminator());
assertEquals(19102, config.rpc().port());
assertEquals("vespa/service/default/container.0", config.rpc().slobrokId());
assertEquals(true, config.rpc().enabled());
assertEquals("", config.rpc().host());
assertEquals(false, config.restartOnDeploy());
assertEquals(false, config.coveragereports());
assertEquals("filedistribution/" + hostname, config.filedistributor().configid());
}
Aggregations