use of com.yahoo.foo.AppConfig in project vespa by vespa-engine.
the class ConfigGetterTest method testGetConfig.
@Test
public void testGetConfig() {
int times = 11;
String message = "testGetConfig";
String a0 = "a0";
String configId = "raw:times " + times + "\nmessage " + message + "\na[1]\na[0].name " + a0;
ConfigGetter<AppConfig> getter = new ConfigGetter<>(AppConfig.class);
AppConfig config = getter.getConfig(configId);
assertThat(config.times(), is(times));
assertThat(config.message(), is(message));
assertThat(config.a().size(), is(1));
assertThat(config.a(0).name(), is(a0));
AppService service = new AppService(configId, sourceSet);
AppConfig serviceConfig = service.getConfig();
assertTrue(service.isConfigured());
assertThat(config, is(serviceConfig));
}
use of com.yahoo.foo.AppConfig in project vespa by vespa-engine.
the class ConfigGetterTest method testGetFromFile.
@Test
public void testGetFromFile() {
ConfigGetter<AppConfig> getter = new ConfigGetter<>(AppConfig.class);
AppConfig config = getter.getConfig("file:src/test/resources/configs/foo/app.cfg");
verifyFooValues(config);
}
use of com.yahoo.foo.AppConfig in project vespa by vespa-engine.
the class ConfigGetterTest method testGetFromRawSource.
@Test
public void testGetFromRawSource() {
ConfigGetter<AppConfig> getter = new ConfigGetter<>(new RawSource("message \"one\""), AppConfig.class);
AppConfig config = getter.getConfig("test");
assertThat(config.message(), is("one"));
}
use of com.yahoo.foo.AppConfig in project vespa by vespa-engine.
the class ConfigGetterTest method testGetFromDir.
@Test
public void testGetFromDir() {
ConfigGetter<AppConfig> getter = new ConfigGetter<>(AppConfig.class);
AppConfig config = getter.getConfig("dir:src/test/resources/configs/foo/");
verifyFooValues(config);
}
use of com.yahoo.foo.AppConfig in project vespa by vespa-engine.
the class ConfigGetterTest method testGetFromDirSource.
@Test
public void testGetFromDirSource() {
AppConfig config = ConfigGetter.getConfig(AppConfig.class, "test", new DirSource(new File("src/test/resources/configs/foo/")));
verifyFooValues(config);
}
Aggregations