Package com.piketec.tpt.api
Interface TptApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
closeTpt()
Close the TPT instance represented by this object.int
getFileFormatVersion()
java.util.Collection<Project>
getOpenProjects()
java.util.Collection<AssessmentGroup>
getSelectedAssessmentGroups()
Retruns the explicitly selectedassessment groups
.java.util.Collection<Assessment>
getSelectedAssessments(boolean traverseSelectedGroups)
Returns the selectedassessments
.Project
getSelectedProject()
Returns the selected TPTProject
ornull
if no project is selected.java.util.Collection<ScenarioGroup>
getSelectedScenarioGroups()
Retruns the explicitly selectedscenario groups
.java.util.Collection<Scenario>
getSelectedScenarios(boolean traverseSelectedGroups)
Returns the selectedscenarios
.Testlet
getSelectedTestlet()
Returns the selectedTestlet
ornull
if no testlet is selected.UtilToolbox
getToolbox()
java.io.File
getTptInstallationDir()
java.lang.String
getTptVersion()
boolean
isReady()
Depending on its configuration, TPT requires some time to load all plugins.Project
newProject(java.io.File f)
Create a new TPTProject
assigned with the givenFile
.OpenResult
openProject(java.io.File f)
Try to open an already existing project and to return a handle for the project (OpenResult.getProject()
).ExecutionStatus
reGenerateOverviewReport(ExecutionConfiguration config)
Start the generation of the overview report.ExecutionStatus
run(ExecutionConfiguration config)
Starts a run for the givenExecutionConfiguration
.void
select(IdentifiableRemote obj)
Selects the object given byobj
within the TPT GUI - if it is selectable (like aScenario
or anAssessment
)void
toFront()
Bring the TPT main window to the front.
-
-
-
Method Detail
-
closeTpt
boolean closeTpt() throws java.rmi.RemoteException
Close the TPT instance represented by this object.- Returns:
false
if the application cannot be closed. Possible reasons are:- the user interrupts the close operation
- a test is currently running and is not been canceled
- other blocking operations prevent TPT from closing
- Throws:
java.rmi.RemoteException
- remote communication problem
-
openProject
OpenResult openProject(java.io.File f) throws ApiException, java.rmi.RemoteException
Try to open an already existing project and to return a handle for the project (OpenResult.getProject()
). If the project is already open, only the handle will be returned. The project is not re-opened. Changes will not been overwritten.Any errors or warnings that occur during the open-operation are stored in the
OpenResult.getLogs()
.- Parameters:
f
- The path to the TPT-file asFile
- Returns:
- A
OpenResult
containing the handle to the project and the log messages occurred during the open-operation. - Throws:
java.rmi.RemoteException
- remote communication problemApiException
- Iff
do not exists or iff
is not a TPT-file.
-
newProject
Project newProject(java.io.File f) throws ApiException, java.rmi.RemoteException
Create a new TPTProject
assigned with the givenFile
. The newProject
will not be saved during this operation. The given file is only relevant for later save operations.- Parameters:
f
- the file to use for this project- Returns:
- the newly created TPT project
- Throws:
java.rmi.RemoteException
- remote communication problemApiException
- If the given File is already opened in TPT- See Also:
Project.saveProject()
,Project.saveAsProject(File)
-
getOpenProjects
java.util.Collection<Project> getOpenProjects() throws java.rmi.RemoteException
- Returns:
- Returns the set of all
Projects
that are currently open in this TPT instance. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getTptVersion
java.lang.String getTptVersion() throws java.rmi.RemoteException
- Returns:
- Returns the version name of the TPT instance represented by this API object.
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getTptInstallationDir
java.io.File getTptInstallationDir() throws java.rmi.RemoteException
- Returns:
- Returns the installation directory of the TPT instance represented by this API object.
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getFileFormatVersion
int getFileFormatVersion() throws java.rmi.RemoteException
- Returns:
- Returns the version number of file format this TPT version will use to store *.tpt-, *.tptz- and *.tptprj-Files when calling save.
- Throws:
java.rmi.RemoteException
- remote communication problem
-
run
ExecutionStatus run(ExecutionConfiguration config) throws ApiException, java.rmi.RemoteException
Starts a run for the givenExecutionConfiguration
. The test run is started asynchronously. The progress of the test run can be monitored via the returnedExecutionStatus
object.- Parameters:
config
- TheExecutionConfiguration
to be executed.- Returns:
- The state of execution for all test cases defined in the
ExecutionConfiguration
- Throws:
ApiException
- if there is already a running test execution or if the test execution could not be startedjava.rmi.RemoteException
- Ifconfig
is not part of the TPT instance represented by this object.
-
reGenerateOverviewReport
ExecutionStatus reGenerateOverviewReport(ExecutionConfiguration config) throws ApiException, java.rmi.RemoteException
Start the generation of the overview report. The generation is done asynchronously.This function does not execute or asses the test cases specified in
config
. It uses the existing result data and XML-files to generate a new overview report.- Parameters:
config
- TheExecutionConfiguration
for which the overview report should be generated.- Returns:
- the current status of report generation
- Throws:
ApiException
- if there is already a running test execution or if the test execution could not be startedjava.rmi.RemoteException
- Ifconfig
is not part of the TPT instance represented by this object.
-
select
void select(IdentifiableRemote obj) throws java.rmi.RemoteException, ApiException
Selects the object given byobj
within the TPT GUI - if it is selectable (like aScenario
or anAssessment
)- Parameters:
obj
- A object that implements theIdentifiableRemote
interface- Throws:
java.rmi.RemoteException
- remote communication problemApiException
- This method is not supported if the API is running in headless mode
-
getSelectedProject
Project getSelectedProject() throws java.rmi.RemoteException
Returns the selected TPTProject
ornull
if no project is selected.- Returns:
- The selected TPT project or
null
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getSelectedTestlet
Testlet getSelectedTestlet() throws java.rmi.RemoteException
Returns the selectedTestlet
ornull
if no testlet is selected.- Returns:
- The selected testlet or
null
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getSelectedScenarios
java.util.Collection<Scenario> getSelectedScenarios(boolean traverseSelectedGroups) throws java.rmi.RemoteException
Returns the selectedscenarios
. If scenarios and/orscenario groups
are selected, groups are irgnored iftraverseSelectedGroups
isfalse
. IftraverseSelectedGroups
istrue
all scenarios contained recursivley in the selected groups are returned as well.- Parameters:
traverseSelectedGroups
-true
if scenarios contained in selected groups shall be returnedfalse
if selected groups shall be ignored.- Returns:
- The selected scenarios
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getSelectedScenarioGroups
java.util.Collection<ScenarioGroup> getSelectedScenarioGroups() throws java.rmi.RemoteException
Retruns the explicitly selectedscenario groups
. If onlyscenarios
are selected the returned collection will be empty.- Returns:
- The explicitly selected scenario groups
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getSelectedAssessments
java.util.Collection<Assessment> getSelectedAssessments(boolean traverseSelectedGroups) throws java.rmi.RemoteException
Returns the selectedassessments
. If assessments and/orassessment groups
are selected, groups are irgnored iftraverseSelectedGroups
isfalse
. IftraverseSelectedGroups
istrue
all assessments contained recursivley in the selected groups are returned as well.- Parameters:
traverseSelectedGroups
-true
if assessments contained in selected groups shall be returnedfalse
if selected groups shall be ignored.- Returns:
- The selected assessmentss
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getSelectedAssessmentGroups
java.util.Collection<AssessmentGroup> getSelectedAssessmentGroups() throws java.rmi.RemoteException
Retruns the explicitly selectedassessment groups
. If onlyassessments
are selected the returned collection will be empty.- Returns:
- The explicitly selected scenario groups
- Throws:
java.rmi.RemoteException
- remote communication problem
-
isReady
boolean isReady() throws java.rmi.RemoteException
Depending on its configuration, TPT requires some time to load all plugins. Since the API is one of the first plugins that are loaded, it can be accessed before TPT is actually fully loaded.This function returns
true
as soon as all plugins have been completely loaded and TPT is ready for use.- Returns:
- Whether TPT has finished its startup
- Throws:
java.rmi.RemoteException
- remote communication problem
-
toFront
void toFront() throws java.rmi.RemoteException
Bring the TPT main window to the front.- Throws:
java.rmi.RemoteException
- remote communication problem
-
getToolbox
UtilToolbox getToolbox() throws java.rmi.RemoteException
- Returns:
- Returns the "toolbox" which contains a set of auxillary functions which are not
directly related to a
Project
or the TPT-Application. - Throws:
java.rmi.RemoteException
- remote communication problem
-
-