use of com.yahoo.vespa.model.VespaModel 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.vespa.model.VespaModel 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.vespa.model.VespaModel 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.vespa.model.VespaModel 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.vespa.model.VespaModel in project vespa by vespa-engine.
the class AdminTestCase method testContainerMetricsSnapshotInterval.
@Test
public void testContainerMetricsSnapshotInterval() throws Exception {
VespaModel vespaModel = getVespaModel(TESTDIR + "metricconfig");
ContainerCluster docprocCluster = vespaModel.getContainerClusters().get("cluster.music.indexing");
HealthMonitorConfig.Builder builder = new HealthMonitorConfig.Builder();
docprocCluster.getConfig(builder);
HealthMonitorConfig docprocConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) docprocConfig.snapshot_interval());
ContainerCluster qrCluster = vespaModel.getContainerClusters().get("container");
builder = new HealthMonitorConfig.Builder();
qrCluster.getConfig(builder);
HealthMonitorConfig qrClusterConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) qrClusterConfig.snapshot_interval());
StatisticsComponent stat = null;
for (Component component : qrCluster.getAllComponents()) {
if (component.getClassId().getName().contains("com.yahoo.statistics.StatisticsImpl")) {
stat = (StatisticsComponent) component;
break;
}
}
assertNotNull(stat);
StatisticsConfig.Builder sb = new StatisticsConfig.Builder();
stat.getConfig(sb);
StatisticsConfig sc = new StatisticsConfig(sb);
assertEquals(60, (int) sc.collectionintervalsec());
assertEquals(60, (int) sc.loggingintervalsec());
}
Aggregations