use of com.yahoo.config.model.producer.UserConfigRepo in project vespa by vespa-engine.
the class UserConfigBuilderTest method no_exception_when_config_class_does_not_exist.
@Test
public void no_exception_when_config_class_does_not_exist() throws ParserConfigurationException, IOException, SAXException {
Element configRoot = getDocument("<config name=\"unknown\">" + " <foo>1</foo>" + "</config>");
UserConfigRepo repo = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
ConfigPayloadBuilder builder = repo.get(new ConfigDefinitionKey("unknown", "config"));
assertNotNull(builder);
}
use of com.yahoo.config.model.producer.UserConfigRepo in project vespa by vespa-engine.
the class FileSenderTest method setup.
@Before
public void setup() {
MockRoot root = new MockRoot();
producer = new SimpleConfigProducer<>(root, "test");
service = new TestService(root, "service");
serviceList = new ArrayList<>();
serviceList.add(service);
ConfigDefinitionKey key = new ConfigDefinitionKey("myname", "mynamespace");
def = new ConfigDefinition("myname", "1", "mynamespace");
builder = new ConfigPayloadBuilder(def);
Map<ConfigDefinitionKey, ConfigPayloadBuilder> builderMap = new HashMap<>();
builderMap.put(key, builder);
UserConfigRepo testRepo = new UserConfigRepo(builderMap);
producer.setUserConfigs(testRepo);
}
use of com.yahoo.config.model.producer.UserConfigRepo in project vespa by vespa-engine.
the class UserConfigBuilder method build.
public static UserConfigRepo build(Element producerSpec, ConfigDefinitionStore configDefinitionStore, DeployLogger deployLogger) {
final Map<ConfigDefinitionKey, ConfigPayloadBuilder> builderMap = new LinkedHashMap<>();
if (producerSpec == null) {
log.log(LogLevel.SPAM, "In getUserConfigs. producerSpec is null");
}
log.log(LogLevel.DEBUG, "getUserConfigs for " + producerSpec);
for (Element configE : XML.getChildren(producerSpec, "config")) {
buildElement(configE, builderMap, configDefinitionStore, deployLogger);
}
return new UserConfigRepo(builderMap);
}
Aggregations