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.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
)
-
-
-
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
-
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
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 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
-
-