Search in sources :

Example 1 with ArraytypesConfig

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

the class UserConfigBuilderTest method require_that_arrays_config_is_resolved.

@Test
public void require_that_arrays_config_is_resolved() throws ParserConfigurationException, IOException, SAXException {
    Element configRoot = getDocument("<config name=\"arraytypes\">" + "    <intarr operation=\"append\">13</intarr>" + "    <intarr operation=\"append\">10</intarr>" + "    <intarr operation=\"append\">1337</intarr>" + "</config>");
    UserConfigRepo map = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
    assertFalse(map.isEmpty());
    ConfigDefinitionKey key = new ConfigDefinitionKey("arraytypes", "config");
    assertNotNull(map.get(key));
    ArraytypesConfig config = createConfig(ArraytypesConfig.class, map.get(key));
    assertThat(config.intarr().size(), is(3));
    assertThat(config.intarr(0), is(13));
    assertThat(config.intarr(1), is(10));
    assertThat(config.intarr(2), is(1337));
}
Also used : UserConfigRepo(com.yahoo.config.model.producer.UserConfigRepo) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) Element(org.w3c.dom.Element) ConfigDefinitionKey(com.yahoo.vespa.config.ConfigDefinitionKey) ArraytypesConfig(com.yahoo.test.ArraytypesConfig) Test(org.junit.Test)

Aggregations

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