use of com.yahoo.cloud.config.ModelConfig in project vespa by vespa-engine.
the class ModelConfigProviderTest method testGetModelConfig.
/**
* Get the config via ConfigInstance based API, by getting whole config
*/
@Test
public void testGetModelConfig() {
VespaModel vespaModel = new VespaModelCreatorWithFilePkg("src/test/cfg/admin/adminconfig20").create();
ModelConfig config = vespaModel.getConfig(ModelConfig.class, "");
assertEquals(config.hosts().size(), 1);
// Actually set to hostname.
ModelConfig.Hosts localhost = config.hosts(0);
int numLogservers = 0;
int numSlobroks = 0;
for (ModelConfig.Hosts.Services service : localhost.services()) {
if ("logserver".equals(service.type())) {
numLogservers++;
}
if ("slobrok".equals(service.type())) {
numSlobroks++;
}
}
assertEquals(1, numLogservers);
assertEquals(2, numSlobroks);
}
Aggregations