Package com.piketec.tpt.api
Interface Testlet
-
- All Superinterfaces:
DiagramNode
,IdentifiableRemote
,NamedObject
,Positioned
,java.rmi.Remote
,TptRemote
public interface Testlet extends DiagramNode, Positioned
A testlet represents the behavior of a state in in the test model. It can either be a graphical state in the diagram or a testlet step in the step list. It has to contain at least onevariant
.It could contain variants for both,
StepListScenarios
orDiagramScenarios
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResultAndLogs<Testlet>
copy(Testlet target)
Copiesthis
into the giventarget
that can be from a differentProject
that is opened in the same TPT instance.DiagramScenario
createDiagVariant(java.lang.String name, ScenarioGroup groupOrNull)
Creates a new diagram variant (DiagramScenario
) or a new test case (if the currentTestlet
is the top-levelTestlet
).Final
createFinal(java.awt.Point pos)
Creat a newFinal
junction at the given positionpos
Junction
createJunction(java.awt.Point pos)
Create a newJunction
at the given positionpos
Line
createLine(int y)
Create a new horizontalLine
with the height (vertical position)y
void
createNewContent()
Creates a new local definition for this state that has not been referenced so far.StepListScenario
createSLVariant(java.lang.String name, ScenarioGroup groupOrNull)
Creates a new step list variant (StepListScenario
) or a new test case (if the currentTestlet
is the top levelTestlet
).Testlet
createTestlet(java.lang.String name)
Create a new state (Testlet
) which is not visible in the diagram and is intended for the use in the step list.Testlet
createTestlet(java.lang.String name, java.awt.Point pos)
Create a new diagram state (Testlet
) at the given positionTextArea
createTextArea(java.lang.String text, java.awt.Point pos)
Transition
createTransition(DiagramNode from, DiagramNode to)
ScenarioGroup
createVariantGroup(java.lang.String name, ScenarioGroup groupOrNull)
Create a newScenarioOrGroup
and add it to the givenScenarioGroup
directly below thisTestlet
, ifgroupOrNull==null
.RemoteCollection<Final>
getFinals()
RemoteCollection<Junction>
getJunctions()
RemoteCollection<Line>
getLines()
RemoteCollection<Testlet>
getStates()
RemoteCollection<TextArea>
getTextAreas()
ScenarioGroup
getToplevelScenarioGroup()
Get the top level group that contains allScenarioOrGroups
that are delivered bygetTopLevelScenarioOrGroup()
.RemoteList<ScenarioOrGroup>
getTopLevelScenarioOrGroup()
RemoteCollection<Transition>
getTransitions()
boolean
hasDefinedContent()
-
Methods inherited from interface com.piketec.tpt.api.diagram.DiagramNode
getParentTestlet
-
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.diagram.Positioned
getPosition, setPosition
-
-
-
-
Method Detail
-
hasDefinedContent
boolean hasDefinedContent() throws java.rmi.RemoteException
- Returns:
- Returns
true
, if this testlet has defined content. This means it is either a testlet or a reference. Returnsfalse
if no content has been set or if the content has been deleted (for example by the context menu in the TPT GUI). - Throws:
java.rmi.RemoteException
- remote communication problem
-
createNewContent
void createNewContent() throws java.rmi.RemoteException
Creates a new local definition for this state that has not been referenced so far. Additionally, aStepListScenario
is created for this state. Any previously existing definition for this state will be replaced by the new one. Any existingScenarios
will be deleted.- Throws:
java.rmi.RemoteException
- remote communication problem
-
createSLVariant
StepListScenario createSLVariant(java.lang.String name, ScenarioGroup groupOrNull) throws ApiException, java.rmi.RemoteException
Creates a new step list variant (StepListScenario
) or a new test case (if the currentTestlet
is the top levelTestlet
). If the parametergroupOrNull==null
, the newly created step list variant is placed directly below the testlet (getTopLevelScenarioOrGroup()
). If a specificScenarioGroup
is given, the newly created variant is placed there.- Parameters:
name
- The name of the newly created variant.Null
will be reduced to an empty string.groupOrNull
- Either the group where the newly createdStepListScenario
should be added ornull
to add it in the top level group of thisTestlet
.- Returns:
- the newly created
StepListScenario
. - Throws:
java.rmi.RemoteException
- remote communication problemApiException
- If the content of theTestlet
is empty.
-
createDiagVariant
DiagramScenario createDiagVariant(java.lang.String name, ScenarioGroup groupOrNull) throws ApiException, java.rmi.RemoteException
Creates a new diagram variant (DiagramScenario
) or a new test case (if the currentTestlet
is the top-levelTestlet
). If the parametergroupOrNull==null
, the newly created StepList variant is placed directly below the Testlet (getTopLevelScenarioOrGroup()
). If a specificScenarioGroup
is given, the newly created variant is placed there.- Parameters:
name
- The name of the new variant.Null
will be reduced to an empty string.groupOrNull
- Either the group where the newly createdDiagramScenario
should be added ornull
to add it in the top-level group of thisTestlet
.- Returns:
- the newly created
DiagramScenario
- Throws:
java.rmi.RemoteException
- remote communication problemApiException
- If the content of theTestlet
is empty
-
createVariantGroup
ScenarioGroup createVariantGroup(java.lang.String name, ScenarioGroup groupOrNull) throws ApiException, java.rmi.RemoteException
Create a newScenarioOrGroup
and add it to the givenScenarioGroup
directly below thisTestlet
, ifgroupOrNull==null
.- Parameters:
name
- The name of the newly created group.Null
will be reduced to an empty string.groupOrNull
- The group, in which the newly createdScenarioGroup
should be added ornull
if it shall be added to the top level group of theTestlet
.- Returns:
- the newly created
ScenarioGroup
- Throws:
java.rmi.RemoteException
- remote communication problemApiException
- If the content of theTestlet
is empty
-
getTopLevelScenarioOrGroup
RemoteList<ScenarioOrGroup> getTopLevelScenarioOrGroup() throws java.rmi.RemoteException
- Returns:
- The list of
ScenarioOrGroup
that are contained in the top level group. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getTransitions
RemoteCollection<Transition> getTransitions() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains allTransitions
in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getLines
RemoteCollection<Line> getLines() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains allLines
in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getTextAreas
RemoteCollection<TextArea> getTextAreas() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains alltext areas
in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getStates
RemoteCollection<Testlet> getStates() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains allTestlets
in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getJunctions
RemoteCollection<Junction> getJunctions() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains allJunctions
in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getFinals
RemoteCollection<Final> getFinals() throws java.rmi.RemoteException
- Returns:
- Returns a
RemoteCollection
that contains all final junctions (Final
) in this hierarchy layer of the diagram. - Throws:
java.rmi.RemoteException
- remote communication problem
-
getToplevelScenarioGroup
ScenarioGroup getToplevelScenarioGroup() throws java.rmi.RemoteException
Get the top level group that contains allScenarioOrGroups
that are delivered bygetTopLevelScenarioOrGroup()
. A call ofScenarioOrGroup.getGroup()
on this group will delivernull
.- Returns:
- the top-level scenario group or
null
if the testlet has no content (hasDefinedContent()
). - Throws:
java.rmi.RemoteException
- remote communication problem
-
createTransition
Transition createTransition(DiagramNode from, DiagramNode to) throws ApiException, java.rmi.RemoteException
Creates a newTransition
from a nodefrom
to a nodeto
. A node can either be aTransition
, aJunction
orApiException
Final
.- Parameters:
from
- ADiagramNode
representing the starting point of theTransition
to
- ADiagramNode
representing the end point of theTransition
- Returns:
- The newly created Transition
- Throws:
ApiException
-- If either
from
orto
are not part of the diagram or - if the Transition would create a cycle that does not contain at least one
Testlet
- If either
java.rmi.RemoteException
- Iffrom
orto
are not part ot this TPT instance.- See Also:
DiagramNode
-
createLine
Line createLine(int y) throws java.rmi.RemoteException
Create a new horizontalLine
with the height (vertical position)y
-
createTextArea
TextArea createTextArea(java.lang.String text, java.awt.Point pos) throws java.rmi.RemoteException
- Parameters:
text
- The text that should be displayed in theTextArea
.Null
will be reduced to an empty string.pos
- The position in the diagram given asPoint
.- Returns:
- The newly created
TextArea
- Throws:
java.rmi.RemoteException
- remote communication problem
-
createTestlet
Testlet createTestlet(java.lang.String name, java.awt.Point pos) throws java.rmi.RemoteException
Create a new diagram state (Testlet
) at the given position- Parameters:
name
- The name of the newly created stateTestlet
.Null
will be reduced to an empty string.pos
- The position of theTestlet
in the diagram given asPoint
- Returns:
- the newly created
Testlet
- Throws:
java.rmi.RemoteException
- remote communication problem
-
createTestlet
Testlet createTestlet(java.lang.String name) throws java.rmi.RemoteException
Create a new state (Testlet
) which is not visible in the diagram and is intended for the use in the step list.- Parameters:
name
- The name of the newly created stateTestlet
.Null
will be reduced to an empty string.- Returns:
- the newly created
Testlet
- Throws:
java.rmi.RemoteException
- remote communication problem
-
createJunction
Junction createJunction(java.awt.Point pos) throws java.rmi.RemoteException
Create a newJunction
at the given positionpos
- Parameters:
pos
- The position in the diagram given asPoint
.- Returns:
- The newly created
Junction
- Throws:
java.rmi.RemoteException
- remote communication problem
-
createFinal
Final createFinal(java.awt.Point pos) throws java.rmi.RemoteException
Creat a newFinal
junction at the given positionpos
- Parameters:
pos
- The Position in the Diagram given asPoint
.- Returns:
- The newly created
Final
- Throws:
java.rmi.RemoteException
- remote communication problem
-
copy
ResultAndLogs<Testlet> copy(Testlet target) throws java.rmi.RemoteException, ApiException
Copiesthis
into the giventarget
that can be from a differentProject
that is opened in the same TPT instance. If thetarget
already contains an element with the same name a new one will be generated.- Parameters:
target
- The testlet to copythis
into. Can be from anotherProject
.- Returns:
- The copy of this and all log messages that occured during copying.
- Throws:
ApiException
- If target isnull
or copying failed.java.rmi.RemoteException
- remote communication problem
-
-