Class TestDriver

java.lang.Object
com.yahoo.config.model.test.TestDriver

public class TestDriver extends Object
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.
Since:
5.1.20
Author:
Ulf Lilleengen
  • Constructor Details

    • TestDriver

      public TestDriver(boolean validate)
    • TestDriver

      public TestDriver()
  • Method Details

    • addBuilder

      public TestDriver addBuilder(ConfigModelBuilder builder)
      Add a new builder to the tester.
      Parameters:
      builder - builder to add.
      Returns:
      this for chaining
    • buildModel

      public TestRoot buildModel(String servicesXml)
      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

      public TestRoot buildModel(String servicesXml, String hostsXml)
      Build a model from an XML string of services and one of hosts.
      Parameters:
      servicesXml - The xml for services.xml
      hostsXml - The xml for hosts.xml
      Returns:
      a producer root capable of answering getConfig requests.
    • buildModel

      public TestRoot buildModel(com.yahoo.config.application.api.ApplicationPackage applicationPackage)
      Build a model from an application package.
      Parameters:
      applicationPackage - Any type of application package.
      Returns:
      a producer root capable of answering getConfig requests.
    • buildModel

      public TestRoot buildModel(DeployState deployState)
      Build a model given a deploy state.
      Parameters:
      deployState - An instance of DeployState
      Returns:
      a producer root capable of answering getConfig requests.