use of com.yahoo.cloud.config.ApplicationIdConfig in project vespa by vespa-engine.
the class VespaModelTestCase method testCommonConfig.
// Verify that common config from plugins is delivered from the root node for any configId, using the Builder based API
@Test
public void testCommonConfig() throws Exception {
VespaModel model = getVespaModel(TESTDIR + "app_nohosts/");
LogdConfig.Builder b = new LogdConfig.Builder();
b = (LogdConfig.Builder) model.getConfig(b, "");
LogdConfig c = new LogdConfig(b);
assertEquals(HostName.getLocalhost(), c.logserver().host());
SlobroksConfig.Builder sb = new SlobroksConfig.Builder();
sb = (com.yahoo.cloud.config.SlobroksConfig.Builder) model.getConfig(sb, "");
SlobroksConfig sbc = new SlobroksConfig(sb);
assertEquals(sbc.slobrok().size(), 1);
ZookeepersConfig.Builder zb = new ZookeepersConfig.Builder();
zb = (ZookeepersConfig.Builder) model.getConfig(zb, "");
ZookeepersConfig zc = new ZookeepersConfig(zb);
assertEquals(zc.zookeeperserverlist().split(",").length, 2);
assertTrue(zc.zookeeperserverlist().startsWith(HostName.getLocalhost()));
ApplicationIdConfig.Builder appIdBuilder = new ApplicationIdConfig.Builder();
appIdBuilder = (ApplicationIdConfig.Builder) model.getConfig(appIdBuilder, "");
ApplicationIdConfig applicationIdConfig = new ApplicationIdConfig(appIdBuilder);
assertEquals(ApplicationId.defaultId().tenant().value(), applicationIdConfig.tenant());
assertEquals(ApplicationId.defaultId().application().value(), applicationIdConfig.application());
assertEquals(ApplicationId.defaultId().instance().value(), applicationIdConfig.instance());
}
use of com.yahoo.cloud.config.ApplicationIdConfig in project vespa by vespa-engine.
the class ApplicationIdTest method require_that_instance_from_config_is_correct.
@Test
public void require_that_instance_from_config_is_correct() {
ApplicationIdConfig.Builder builder = new ApplicationIdConfig.Builder();
builder.tenant("a");
builder.application("b");
builder.instance("c");
ApplicationId applicationId = new ApplicationId(new ApplicationIdConfig(builder));
assertEquals("a", applicationId.tenant().value());
assertEquals("b", applicationId.application().value());
assertEquals("c", applicationId.instance().value());
}
Aggregations