Package com.yahoo.config.model.test
Class TestDriver
java.lang.Object
com.yahoo.config.model.test.TestDriver
Test driver for testing config models. Add custom builders for plugins to be tested. Builds a model from the
xml string and returns a config producer that can be use to test getConfig.
- Author:
- Ulf Lilleengen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddBuilder
(ConfigModelBuilder builder) Add a new builder to the tester.buildModel
(com.yahoo.config.application.api.ApplicationPackage applicationPackage) Build a model from an application package.buildModel
(DeployState deployState) Build a model given a deploy state.buildModel
(String servicesXml) Build a model from an XML string.buildModel
(String servicesXml, String hostsXml) Build a model from an XML string of services and one of hosts.
-
Constructor Details
-
TestDriver
public TestDriver(boolean validate) -
TestDriver
public TestDriver()
-
-
Method Details
-
addBuilder
Add a new builder to the tester.- Parameters:
builder
- builder to add.- Returns:
- this for chaining
-
buildModel
Build a model from an XML string. The hosts referenced in services must be set to 'mockhost' when using this method, as it automatically generates a hosts file for you.- Parameters:
servicesXml
- The xml for services.xml- Returns:
- a producer root capable of answering getConfig requests.
-
buildModel
Build a model from an XML string of services and one of hosts.- Parameters:
servicesXml
- The xml for services.xmlhostsXml
- The xml for hosts.xml- Returns:
- a producer root capable of answering getConfig requests.
-
buildModel
Build a model from an application package.- Parameters:
applicationPackage
- Any type of application package.- Returns:
- a producer root capable of answering getConfig requests.
-
buildModel
Build a model given a deploy state.- Parameters:
deployState
- An instance ofDeployState
- Returns:
- a producer root capable of answering getConfig requests.
-