Package com.sun.javatest
Class TestEnvContext
java.lang.Object
com.sun.javatest.TestEnvContext
A table representing the collection of environments found in a set of environment files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This exception is to report problems usingTestEnvContext
objects. -
Constructor Summary
ConstructorsConstructorDescriptionTestEnvContext
(File... files) Create a context from a set of environment (.jte) files.TestEnvContext
(Map<String, String>[] tables, String... tableNames) Create a context from a specified set of named tables.TestEnvContext
(Map<String, String> table, String tableName) Create a context from a named table. -
Method Summary
Modifier and TypeMethodDescriptionGet a environment from this set of environments.String[]
Get an array containing all the names of environments that should appear in a menu of valid environment names.String[]
Get an array containing all the names of environments in this set of environments.boolean
isValidEnv
(String name) Check if a name matches the name of one of the environments in this set of environments.
-
Constructor Details
-
TestEnvContext
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
Create a context from a specified set of named tables.- Parameters:
tables
- An array of tables giving the properties to be readtableNames
- 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
Create a context from a named table.- Parameters:
table
- A table giving the properties to be readtableName
- The name that will be used to identify the source of the properties in any environments that are created.
-
-
Method Details
-
getEnv
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
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
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
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
-