Package com.piketec.tpt.api
Interface ScenarioOrGroup
-
- All Superinterfaces:
IdentifiableRemote
,NamedObject
,java.rmi.Remote
,TptRemote
,UUIDObject
- All Known Subinterfaces:
DiagramScenario
,Scenario
,ScenarioGroup
,StepListScenario
public interface ScenarioOrGroup extends NamedObject, IdentifiableRemote, UUIDObject
This object either represents aScenario
or aScenarioGroup
. It represents a node within the tree structure defined by scenarios and scenario groups.In TPT, it represents both the tree of variants and variant groups as well as the test cases and test case groups. Both can be assigned with a description as well as parameters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ResultAndLogs<ScenarioOrGroup>
copy(ScenarioGroup targetGroup, int targetIndex)
Copiesthis
into the giventargetGroup
that can be from a differentProject
that is opened in the same TPT instance.java.lang.String
getDescription()
ScenarioGroup
getGroup()
Get the parent scenario group ornull
if this object reside on the top level (meaning directly below the aTestlet
).int
getId()
Deprecated.Removed in TPT-19.java.lang.String
getIdString()
java.lang.String
getInitialValue(java.lang.String declarationName)
Returns the initial value for a givendeclarationName
as defined for thisScenarioOrGroup
.java.util.List<java.lang.String>
getInitialValues()
Returns a list of variables for which this test case/variant directly defines an initial value.java.lang.String
getTestCaseAttributeValue(java.lang.String name)
Returns the value for a givenTestCaseAttribute
that is defined for this Scenario.Testlet
getTestlet()
boolean
isGroup()
boolean
isTestcaseOrGroup()
Returnstrue
if this ScenarioOrGroup represents a test case or test case group.void
move(ScenarioGroup newParent, int index)
Moves thisScenarioOrGroup
to a new position in the scenario tree.void
setDescription(java.lang.String description)
Set the testual description for thisScenarioOrGroup
to be displayed in the Description view of TPT.void
setInitialValue(java.lang.String declarationName, java.lang.String value)
Set a given initialvalue
for a givendeclarationName
for thisScenarioOrGroup
.void
setStatus(java.lang.String author, java.lang.String comment, java.lang.String status)
Set the status of the scenario or group.void
setTestCaseAttributeValue(java.lang.String name, java.lang.String value)
-
Methods inherited from interface com.piketec.tpt.api.IdentifiableRemote
getIdentifier
-
Methods inherited from interface com.piketec.tpt.api.NamedObject
getName, setName
-
Methods inherited from interface com.piketec.tpt.api.util.UUIDObject
getUUID
-
-
-
-
Method Detail
-
getDescription
java.lang.String getDescription() throws java.rmi.RemoteException
- Returns:
- Returns the textual description of this
ScenarioOrGroup
(displayed int the Description view of TPT). - Throws:
java.rmi.RemoteException
- remote communication problem
-
setDescription
void setDescription(java.lang.String description) throws java.rmi.RemoteException
Set the testual description for thisScenarioOrGroup
to be displayed in the Description view of TPT.- Parameters:
description
- The new description.- Throws:
java.rmi.RemoteException
- remote communication problem
-
getGroup
ScenarioGroup getGroup() throws java.rmi.RemoteException
Get the parent scenario group ornull
if this object reside on the top level (meaning directly below the aTestlet
).- Returns:
- the parent group or
null
- Throws:
java.rmi.RemoteException
- remote communication problem
-
isGroup
boolean isGroup() throws java.rmi.RemoteException
- Returns:
true
if this is aScenarioGroup
,false
otherwise.- Throws:
java.rmi.RemoteException
- remote communication problem
-
getTestlet
Testlet getTestlet() throws java.rmi.RemoteException
- Returns:
- Returns the
Testlet
thisScenarioOrGroup
belongs to. In case this object is a test case (seeisTestcaseOrGroup()
) the "main" testlet is returned. - Throws:
java.rmi.RemoteException
- remote communication problem
-
isTestcaseOrGroup
boolean isTestcaseOrGroup() throws java.rmi.RemoteException
Returnstrue
if this ScenarioOrGroup represents a test case or test case group. AScenario
is a test case, if it is within or a child of theScenarios
of the top level testlet. Otherwise, it is a variant in a one of thesub-testlets
.- Returns:
true
if it is a test case or test case groupfalse
if it is a variant or variant group
- Throws:
java.rmi.RemoteException
- remote communication problem
-
setInitialValue
void setInitialValue(java.lang.String declarationName, java.lang.String value) throws ApiException, java.rmi.RemoteException
Set a given initialvalue
for a givendeclarationName
for thisScenarioOrGroup
. This corresponds to the initial values tab for test cases and variants. Child nodes inherit the setting from their parent groups.- Parameters:
declarationName
- The name of theDeclaration
. Struct members and array accesses with constant index are also supported.value
- The new value for thedeclarationName
ornull
to remove a value specific to thisScenarioOrGroup
.- Throws:
ApiException
-- if the name of the declaration does not exists or
- the declaration is a read only parameter.
java.rmi.RemoteException
- remote communication problem
-
getInitialValue
java.lang.String getInitialValue(java.lang.String declarationName) throws ApiException, java.rmi.RemoteException
Returns the initial value for a givendeclarationName
as defined for thisScenarioOrGroup
. Returnsnull
if no value has been set for thisScenarioOrGroup
.- Parameters:
declarationName
- Name of theDeclaration
. Struct members and array accesses with constant index are also supported.- Returns:
null
or the currently set value.- Throws:
ApiException
-- if the name of the parameter does not exists or
- the declaration is a read only parameter.
java.rmi.RemoteException
- remote communication problem
-
getInitialValues
java.util.List<java.lang.String> getInitialValues() throws java.rmi.RemoteException
Returns a list of variables for which this test case/variant directly defines an initial value.- Returns:
- list of variables for which this test case/variant directly defines an initial value.
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getTestCaseAttributeValue
java.lang.String getTestCaseAttributeValue(java.lang.String name) throws ApiException, java.rmi.RemoteException
Returns the value for a givenTestCaseAttribute
that is defined for this Scenario.TestCaseAttributes
are only available for test cases. The type of the Scenario can be determined usingisTestcaseOrGroup()
.- Parameters:
name
- Thename
of theTestCaseAttribute
.- Returns:
- The current
value
of theTestCaseAttribute
- Throws:
ApiException
- If thename == null
or if noTestCaseAttribute
with the given name has been defined.java.rmi.RemoteException
- remote communication problem- See Also:
createTestCaseAttribute(String, TestCaseAttributeType))
-
setTestCaseAttributeValue
void setTestCaseAttributeValue(java.lang.String name, java.lang.String value) throws ApiException, java.rmi.RemoteException
Set thevalue
for theTestCaseAttribute
of a givenname
for thisScenarioOrGroup
.TestCaseAttributes
are only available for test cases. The type of the Scenario can be determined usingisTestcaseOrGroup()
.- Parameters:
name
- Thename
of theTestCaseAttribute
value
- The newvalue
for theTestCaseAttribute
with the givenname
- Throws:
ApiException
- Ifname==null
or if there exists noTestCaseAttribute
with the given name or if the given value does not match thetype
of the attribute.java.rmi.RemoteException
- remote communication problem
-
setStatus
void setStatus(java.lang.String author, java.lang.String comment, java.lang.String status) throws ApiException, java.rmi.RemoteException
Set the status of the scenario or group.- Parameters:
author
- The author of the status.Null
will be reduced to an empty string.comment
- The comment of the status.Null
will be reduced to an empty string.status
- The status type of the status.- Throws:
ApiException
- If this is not a test case or test case group,author
contains line breaks, or givenstatus
is invalid.java.rmi.RemoteException
- remote communication problem- See Also:
Project.createStatusType(String)
-
getId
@Deprecated int getId() throws java.rmi.RemoteException
Deprecated.Removed in TPT-19. ThrowsDeprecatedAndRemovedException
. Since TPT-16 scenario IDs are strings. UsegetIdString()
instead.- Returns:
- the scenario or scenario group ID.
- Throws:
java.rmi.RemoteException
- remote communication problemApiException
- If the ID of the assessment is not an integer
-
getIdString
java.lang.String getIdString() throws java.rmi.RemoteException
- Returns:
- the scenario or scenario group ID.
- Throws:
java.rmi.RemoteException
- remote communication problem
-
move
void move(ScenarioGroup newParent, int index) throws ApiException, java.rmi.RemoteException
Moves thisScenarioOrGroup
to a new position in the scenario tree.- Parameters:
newParent
- the new parentScenarioGroup
.index
- the new position under the new parent.- Throws:
ApiException
- IfnewParent==null
or the new parent is for an other reason invalid.java.rmi.RemoteException
- remote communication problem
-
copy
ResultAndLogs<ScenarioOrGroup> copy(ScenarioGroup targetGroup, int targetIndex) throws ApiException, java.rmi.RemoteException
Copiesthis
into the giventargetGroup
that can be from a differentProject
that is opened in the same TPT instance. If thetargetGroup
already contains an element with the same name a new one will be generated.- Parameters:
targetGroup
- The group to copythis
into. Can be from anotherProject
.targetIndex
- The index where the copy will be inserted. UseInteger.MAX_VALUE
to append the copy at the end.- Returns:
- The copy of this and all log messages that occured during copying.
- Throws:
ApiException
- If targetGroup isnull
or copying failed.java.rmi.RemoteException
- remote communication problem
-
-