Search in sources :

Example 1 with ConfigDefinitionRepo

use of com.yahoo.config.model.api.ConfigDefinitionRepo in project vespa by vespa-engine.

the class StaticConfigDefinitionRepoTest method testThatRepoIsCorrectlyInitialized.

@Test
public void testThatRepoIsCorrectlyInitialized() throws IOException {
    File topDir = folder.newFolder();
    File defDir = new File(topDir, "classes");
    defDir.mkdir();
    addFile(defDir, new ConfigDefinitionKey("foo", "foons"), "namespace=foons\nval int\n");
    addFile(defDir, new ConfigDefinitionKey("bar", "barns"), "namespace=barns\nval string\n");
    ConfigDefinitionRepo repo = new StaticConfigDefinitionRepo(defDir);
    assertThat(repo.getConfigDefinitions().size(), is(2));
}
Also used : StaticConfigDefinitionRepo(com.yahoo.config.model.application.provider.StaticConfigDefinitionRepo) ConfigDefinitionKey(com.yahoo.vespa.config.ConfigDefinitionKey) File(java.io.File) StaticConfigDefinitionRepo(com.yahoo.config.model.application.provider.StaticConfigDefinitionRepo) ConfigDefinitionRepo(com.yahoo.config.model.api.ConfigDefinitionRepo) Test(org.junit.Test)

Example 2 with ConfigDefinitionRepo

use of com.yahoo.config.model.api.ConfigDefinitionRepo in project vespa by vespa-engine.

the class DeployStateTest method createDeployState.

private DeployState createDeployState(ApplicationPackage app, Map<ConfigDefinitionKey, com.yahoo.vespa.config.buildergen.ConfigDefinition> defs) {
    DeployState.Builder builder = new DeployState.Builder().applicationPackage(app);
    builder.configDefinitionRepo(new ConfigDefinitionRepo() {

        @Override
        public Map<ConfigDefinitionKey, com.yahoo.vespa.config.buildergen.ConfigDefinition> getConfigDefinitions() {
            return defs;
        }
    });
    return builder.build(true);
}
Also used : ConfigDefinitionRepo(com.yahoo.config.model.api.ConfigDefinitionRepo) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

ConfigDefinitionRepo (com.yahoo.config.model.api.ConfigDefinitionRepo)2 StaticConfigDefinitionRepo (com.yahoo.config.model.application.provider.StaticConfigDefinitionRepo)1 ConfigDefinitionKey (com.yahoo.vespa.config.ConfigDefinitionKey)1 File (java.io.File)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Test (org.junit.Test)1