Class TestEnvContext

java.lang.Object
com.sun.javatest.TestEnvContext

public class TestEnvContext extends Object
A table representing the collection of environments found in a set of environment files.
  • Constructor Details

    • TestEnvContext

      public TestEnvContext(File... files) throws TestEnvContext.Fault
      Create a context from a set of environment (.jte) files.
      Parameters:
      files - The environment files to read
      Throws:
      TestEnvContext.Fault - if an error is found while reading the files
    • TestEnvContext

      public TestEnvContext(Map<String,String>[] tables, String... tableNames)
      Create a context from a specified set of named tables.
      Parameters:
      tables - An array of tables giving the properties to be read
      tableNames - An array of names, one for each table in the tables array, that will be used to identify the source of the properties in any environments that are created
    • TestEnvContext

      public TestEnvContext(Map<String,String> table, String tableName)
      Create a context from a named table.
      Parameters:
      table - A table giving the properties to be read
      tableName - The name that will be used to identify the source of the properties in any environments that are created.
  • Method Details

    • getEnv

      public TestEnvironment getEnv(String name) throws TestEnvironment.Fault
      Get a environment from this set of environments.
      Parameters:
      name - the name of the desired environment
      Returns:
      the specified environment, or null if not found
      Throws:
      TestEnvironment.Fault - if there is a problem creating the specified environment
    • isValidEnv

      public boolean isValidEnv(String name)
      Check if a name matches the name of one of the environments in this set of environments.
      Parameters:
      name - the name to check
      Returns:
      true if and only if the name matches the name of one of the environments in trhis set of environments
    • getEnvNames

      public String[] getEnvNames()
      Get an array containing all the names of environments in this set of environments.
      Returns:
      an array containing the names of all the environments in this set
    • getEnvMenuNames

      public String[] getEnvMenuNames()
      Get an array containing all the names of environments that should appear in a menu of valid environment names. This is all environment names, excluding those environments that define an entry "menu=false".
      Returns:
      an array containing the names of all the environments in this set that should appear in a menu of valid environment names