Package com.yahoo.config.model.test
Class TestRoot
java.lang.Object
com.yahoo.config.model.test.TestRoot
Test utility class that provides many methods for inspecting the state of a completely built model
- Author:
- Ulf Lilleengen
-
Method Summary
Modifier and TypeMethodDescription<BUILDER extends com.yahoo.config.ConfigInstance.Builder>
BUILDERAsk model to populate builder with config for a given config id.<CONFIGTYPE extends com.yahoo.config.ConfigInstance>
CONFIGTYPERequest config of a given type and id.<MODEL extends ConfigModel>
List<MODEL>getConfigModels
(Class<MODEL> clazz) Get a list of all config models of a particular type.getHosts()
Retrieve the hosts available in this model.
-
Method Details
-
getConfigModels
Get a list of all config models of a particular type.- Parameters:
clazz
- The class of the models to find.- Returns:
- A list of models of given type.
-
getConfig
public <BUILDER extends com.yahoo.config.ConfigInstance.Builder> BUILDER getConfig(BUILDER builder, String configId) Ask model to populate builder with config for a given config id. This method gives the same config as the configserver would return to its clients.- Parameters:
builder
- The builder to populateconfigId
- The config id of the producer to ask for config.- Returns:
- the same builder.
-
getConfig
public <CONFIGTYPE extends com.yahoo.config.ConfigInstance> CONFIGTYPE getConfig(Class<CONFIGTYPE> clazz, String configId) Request config of a given type and id. This method gives the same config as the configserver would return to its clients.- Parameters:
clazz
- Type of config to request.configId
- The config id of the producer to ask for config.- Returns:
- A config object of the appropriate type with config values set.
-
getHosts
Retrieve the hosts available in this model. Useful to verify that hostnames are set correctly etc.- Returns:
- A list of hosts.
-