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));
}
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");
}
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"));
}
Aggregations