Search in sources :

Example 1 with ApplicationIdConfig

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());
}
Also used : SlobroksConfig(com.yahoo.cloud.config.SlobroksConfig) ApplicationIdConfig(com.yahoo.cloud.config.ApplicationIdConfig) LogdConfig(com.yahoo.cloud.config.log.LogdConfig) VespaModel(com.yahoo.vespa.model.VespaModel) ZookeepersConfig(com.yahoo.cloud.config.ZookeepersConfig) Test(org.junit.Test)

Example 2 with ApplicationIdConfig

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());
}
Also used : ApplicationIdConfig(com.yahoo.cloud.config.ApplicationIdConfig) Test(org.junit.Test)

Aggregations

ApplicationIdConfig (com.yahoo.cloud.config.ApplicationIdConfig)2 Test (org.junit.Test)2 SlobroksConfig (com.yahoo.cloud.config.SlobroksConfig)1 ZookeepersConfig (com.yahoo.cloud.config.ZookeepersConfig)1 LogdConfig (com.yahoo.cloud.config.log.LogdConfig)1 VespaModel (com.yahoo.vespa.model.VespaModel)1