Search in sources :

Example 1 with SimpletypesConfig

use of com.yahoo.test.SimpletypesConfig in project vespa by vespa-engine.

the class Federation2Test method testProviderConfigs.

@Test
public void testProviderConfigs() {
    // SimpletypesConfig testConfig = root.getConfig(SimpletypesConfig.class, "test/searchchains/chain/chain1/component/com.yahoo.example.TestSearcher");
    // assertEquals("testSearcher",testConfig.stringval());
    SimpletypesConfig configA = root.getConfig(SimpletypesConfig.class, "searchchains/chain/providerA/source/commonSource/component/com.yahoo.example.AddHitSearcher");
    assertEquals("providerA", configA.stringval());
    SimpletypesConfig configB = root.getConfig(SimpletypesConfig.class, "searchchains/chain/providerB/source/commonSource/component/com.yahoo.example.AddHitSearcher");
    assertEquals("providerB", configB.stringval());
}
Also used : SimpletypesConfig(com.yahoo.test.SimpletypesConfig) Test(org.junit.Test)

Example 2 with SimpletypesConfig

use of com.yahoo.test.SimpletypesConfig in project vespa by vespa-engine.

the class UserConfigBuilderTest method require_that_simple_config_is_resolved.

@Test
public void require_that_simple_config_is_resolved() throws ParserConfigurationException, IOException, SAXException {
    Element configRoot = getDocument("<config name=\"simpletypes\">" + "    <intval>13</intval>" + "</config>" + "<config name=\"simpletypes\" version=\"1\">" + "    <stringval>foolio</stringval>" + "</config>");
    UserConfigRepo map = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
    assertFalse(map.isEmpty());
    ConfigDefinitionKey key = new ConfigDefinitionKey("simpletypes", "config");
    assertNotNull(map.get(key));
    SimpletypesConfig config = createConfig(SimpletypesConfig.class, map.get(key));
    assertThat(config.intval(), is(13));
    assertThat(config.stringval(), is("foolio"));
}
Also used : UserConfigRepo(com.yahoo.config.model.producer.UserConfigRepo) SimpletypesConfig(com.yahoo.test.SimpletypesConfig) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) Element(org.w3c.dom.Element) ConfigDefinitionKey(com.yahoo.vespa.config.ConfigDefinitionKey) Test(org.junit.Test)

Aggregations

SimpletypesConfig (com.yahoo.test.SimpletypesConfig)2 Test (org.junit.Test)2 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)1 UserConfigRepo (com.yahoo.config.model.producer.UserConfigRepo)1 ConfigDefinitionKey (com.yahoo.vespa.config.ConfigDefinitionKey)1 Element (org.w3c.dom.Element)1