Search in sources :

Example 6 with LogdConfig

use of com.yahoo.cloud.config.log.LogdConfig in project vespa by vespa-engine.

the class AbstractConfigProducerTest method require_that_interface_is_found_if_inherited.

@Test
public void require_that_interface_is_found_if_inherited() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    MockLogdProducerSubclass producer = new MockLogdProducerSubclass("mocky");
    ClassLoader loader = producer.getConfigClassLoader(LogdConfig.Producer.class.getName());
    assertNotNull(loader);
    Class clazz = loader.loadClass(LogdConfig.Builder.class.getName());
    LogdConfig.Builder builder = (LogdConfig.Builder) clazz.newInstance();
    producer.getConfig(builder);
    LogdConfig config = new LogdConfig(builder);
    assertThat(config.logserver().host(), is("foo"));
    assertThat(config.logserver().port(), is(1337));
}
Also used : LogdConfig(com.yahoo.cloud.config.log.LogdConfig) Test(org.junit.Test)

Example 7 with LogdConfig

use of com.yahoo.cloud.config.log.LogdConfig in project vespa by vespa-engine.

the class VespaModelTestCase method testHostsOverrides.

@Test
public void testHostsOverrides() throws IOException, SAXException {
    VespaModel model = new VespaModelCreatorWithMockPkg(simpleHosts, "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "<services  version=\"1.0\">" + "<config name=\"cloud.config.log.logd\">" + "<logserver><host>foo</host></logserver>" + "</config>" + "<admin  version=\"2.0\">" + "  <adminserver hostalias=\"node0\" />" + "</admin>" + "</services>").create();
    LogdConfig config = getLogdConfig(model, "");
    assertNotNull(config);
    assertEquals(config.logserver().host(), "foo");
    config = getLogdConfig(model, "hosts/" + HostName.getLocalhost() + "/logd");
    assertNotNull(config);
    assertEquals(config.logserver().host(), "foo");
}
Also used : VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) LogdConfig(com.yahoo.cloud.config.log.LogdConfig) VespaModel(com.yahoo.vespa.model.VespaModel) Test(org.junit.Test)

Example 8 with LogdConfig

use of com.yahoo.cloud.config.log.LogdConfig in project vespa by vespa-engine.

the class VespaModelTestCase method testNoAdmin.

@Test
public void testNoAdmin() {
    VespaModel model = CommonVespaModelSetup.createVespaModelWithMusic(simpleHosts, "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "<services version=\"1.0\">" + "</services>");
    Admin admin = model.getAdmin();
    assertThat(admin.getSlobroks().size(), is(1));
    assertThat(admin.getConfigservers().size(), is(1));
    Set<HostInfo> hosts = model.getHosts();
    assertThat(hosts.size(), is(1));
    // logd, config proxy, sentinel, config server, slobrok, log server
    HostInfo host = hosts.iterator().next();
    assertThat(host.getServices().size(), is(6));
    new LogdConfig((LogdConfig.Builder) model.getConfig(new LogdConfig.Builder(), "admin/model"));
}
Also used : LogdConfig(com.yahoo.cloud.config.log.LogdConfig) VespaModel(com.yahoo.vespa.model.VespaModel) Admin(com.yahoo.vespa.model.admin.Admin) HostInfo(com.yahoo.config.model.api.HostInfo) Test(org.junit.Test)

Aggregations

LogdConfig (com.yahoo.cloud.config.log.LogdConfig)8 Test (org.junit.Test)8 VespaModel (com.yahoo.vespa.model.VespaModel)5 SlobroksConfig (com.yahoo.cloud.config.SlobroksConfig)2 ApplicationIdConfig (com.yahoo.cloud.config.ApplicationIdConfig)1 SentinelConfig (com.yahoo.cloud.config.SentinelConfig)1 Slobrok (com.yahoo.cloud.config.SlobroksConfig.Slobrok)1 ZookeepersConfig (com.yahoo.cloud.config.ZookeepersConfig)1 ApplicationConfigProducerRoot (com.yahoo.config.model.ApplicationConfigProducerRoot)1 HostInfo (com.yahoo.config.model.api.HostInfo)1 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 Admin (com.yahoo.vespa.model.admin.Admin)1 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)1