public class TestSuiteModel extends Object implements IResourceChangeListener
Modifier and Type | Class and Description |
---|---|
class |
TestSuiteModel.Variable |
Modifier and Type | Field and Description |
---|---|
static String |
CODE_LOCATION_TEST_SETUP |
static String |
CODE_LOCATION_TEST_TEARDOWN |
static String |
CODE_LOCATION_TESTFILE_SETUP |
static String |
CODE_LOCATION_TESTFILE_TEARDOWN |
static String |
CODE_LOCATION_TESTSUITE_SETUP |
static String |
CODE_LOCATION_TESTSUITE_TEARDOWN |
static String |
FLAG_EXECUTE_TEARDOWN_ON_FAILURE |
static String |
FLAG_MAX_THREADS |
static String |
FLAG_PROMOTE_ERRORS_TO_FAILURES |
static String |
FLAG_STOP_SUITE_ON_FAILURE |
Constructor and Description |
---|
TestSuiteModel() |
TestSuiteModel(IFile file) |
Modifier and Type | Method and Description |
---|---|
void |
addTestFile(String fileLocation) |
void |
addVariable(String identifier,
String content,
String description,
IPath path)
Add a variable to the model.
|
void |
close() |
String |
getCodeFragment(String identifier) |
Map<String,String> |
getCodeFragments() |
String |
getDescription() |
IFile |
getFile() |
boolean |
getFlag(String flagID,
boolean defaultValue) |
int |
getFlag(String flagID,
int defaultValue) |
Collection<String> |
getTestFiles() |
TestSuiteModel.Variable |
getVariable(String identifier)
Get the variable defined by the given identifier.
|
List<TestSuiteModel.Variable> |
getVariables()
Get all available variables.
|
boolean |
hasVariable(String identifier)
Check if a variable with the given identifier exists in the current model.
|
boolean |
isDirty() |
void |
load(String text) |
void |
reload() |
void |
removeVariable(TestSuiteModel.Variable variable)
Remove the variable from the model.
|
void |
resourceChanged(IResourceChangeEvent event) |
void |
setCodeFragment(String identifier,
String code) |
void |
setDescription(String description) |
void |
setFlag(String flagID,
boolean content) |
void |
setFlag(String flagID,
int content) |
void |
setFlag(String flagID,
String content) |
void |
setVariable(String identifier,
String content,
String description,
IPath path)
Set the content of a variable defined by the given identifier.
|
XMLMemento |
toMemento() |
public static final String CODE_LOCATION_TESTSUITE_SETUP
public static final String CODE_LOCATION_TESTSUITE_TEARDOWN
public static final String CODE_LOCATION_TESTFILE_SETUP
public static final String CODE_LOCATION_TESTFILE_TEARDOWN
public static final String CODE_LOCATION_TEST_SETUP
public static final String CODE_LOCATION_TEST_TEARDOWN
public static final String FLAG_MAX_THREADS
public static final String FLAG_STOP_SUITE_ON_FAILURE
public static final String FLAG_PROMOTE_ERRORS_TO_FAILURES
public static final String FLAG_EXECUTE_TEARDOWN_ON_FAILURE
public TestSuiteModel(IFile file) throws IOException, CoreException
IOException
CoreException
public TestSuiteModel()
public void close()
public boolean getFlag(String flagID, boolean defaultValue)
public int getFlag(String flagID, int defaultValue)
public void setFlag(String flagID, boolean content)
public void setFlag(String flagID, int content)
public Collection<String> getTestFiles()
public void load(String text)
public XMLMemento toMemento()
public void addTestFile(String fileLocation)
public IFile getFile()
public void addVariable(String identifier, String content, String description, IPath path)
identifier
- unique identifier for the variablecontent
- content for the variabledescription
- description of the variable or null
path
- path of the variablepublic TestSuiteModel.Variable getVariable(String identifier)
null
is returned.identifier
- unique identifier for the variablenull
public List<TestSuiteModel.Variable> getVariables()
public boolean hasVariable(String identifier)
identifier
- unique identifier of the variablepublic void setVariable(String identifier, String content, String description, IPath path)
identifier
- unique identifier for the variablecontent
- content for the variabledescription
- Description of the variable. if the description must not be changed pass null
as value.path
- path of the variablepublic void removeVariable(TestSuiteModel.Variable variable)
variable
- instance of the variablepublic void setDescription(String description)
public String getDescription()
public void reload() throws IOException, CoreException
IOException
CoreException
public boolean isDirty()
public void resourceChanged(IResourceChangeEvent event)
resourceChanged
in interface IResourceChangeListener