Class TestRoot


  • @Beta
    public class TestRoot
    extends java.lang.Object
    Test utility class that provides many methods for inspecting the state of a completely built model
    Since:
    5.1
    Author:
    Ulf Lilleengen
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <BUILDER extends com.yahoo.config.ConfigInstance.Builder>
      BUILDER
      getConfig​(BUILDER builder, java.lang.String configId)
      Ask model to populate builder with config for a given config id.
      <CONFIGTYPE extends com.yahoo.config.ConfigInstance>
      CONFIGTYPE
      getConfig​(java.lang.Class<CONFIGTYPE> clazz, java.lang.String configId)
      Request config of a given type and id.
      <MODEL extends ConfigModel>
      java.util.List<MODEL>
      getConfigModels​(java.lang.Class<MODEL> clazz)
      Get a list of all config models of a particular type.
      java.util.List<HostResource> getHosts()
      Retrieve the hosts available in this model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getConfigModels

        public <MODEL extends ConfigModel> java.util.List<MODEL> getConfigModels​(java.lang.Class<MODEL> clazz)
        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,
                                                                                           java.lang.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 populate
        configId - The config id of the producer to ask for config.
        Returns:
        the same builder.
      • getConfig

        public <CONFIGTYPE extends com.yahoo.config.ConfigInstance> CONFIGTYPE getConfig​(java.lang.Class<CONFIGTYPE> clazz,
                                                                                         java.lang.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

        public java.util.List<HostResource> getHosts()
        Retrieve the hosts available in this model. Useful to verify that hostnames are set correctly etc.
        Returns:
        A list of hosts.