org.squashtest.tm.domain.campaign
Class IterationTestPlanItem

java.lang.Object
  extended by org.squashtest.tm.domain.campaign.IterationTestPlanItem
All Implemented Interfaces:
Identified, HasExecutionStatus

@Entity
public class IterationTestPlanItem
extends Object
implements HasExecutionStatus, Identified


Constructor Summary
IterationTestPlanItem()
           
 
Method Summary
 void addExecution(Execution execution)
           
 void addTestSuite(TestSuite suite)
           
 Execution createAutomatedExecution()
           
 IterationTestPlanItem createCopy()
          Factory method.
 Execution createExecution()
          Creates an execution of this item and returns it.
static Collection<IterationTestPlanItem> createTestPlanItems(TestCase testCase, Collection<Dataset> datasets)
          Creates a collection of test plan items for the given test case and datasets.
static IterationTestPlanItem createUnparameterizedTestPlanItem(TestCase testCase)
          Creates a test plan item for the given test case. the test plan item won't be parameterized (ie no dataset).
 void emptyExecutions()
           
 TestCaseExecutionMode getExecutionMode()
           
 List<Execution> getExecutions()
           
 ExecutionStatus getExecutionStatus()
           
 Long getId()
           
 Iteration getIteration()
           
 String getLabel()
           
 String getLastExecutedBy()
           
 Date getLastExecutedOn()
           
 Execution getLatestExecution()
           
 Set<ExecutionStatus> getLegalStatusSet()
           
 Project getProject()
           
 Dataset getReferencedDataset()
           
 TestCase getReferencedTestCase()
           
 String getTestSuiteNames()
           
 List<TestSuite> getTestSuites()
           
 User getUser()
           
 boolean isAutomated()
           
 boolean isExecutableThroughIteration()
           
 boolean isExecutableThroughTestSuite()
           
 boolean isTestCaseDeleted()
          One should use isExecutableThroughIteration() in favor of this method.
 void removeExecution(Execution execution)
           
 void removeTestSuite(TestSuite suite)
           
 void setExecutionStatus(ExecutionStatus executionStatus)
           
 void setLabel(String label)
           
 void setLastExecutedBy(String lastExecutedBy)
           
 void setLastExecutedOn(Date lastExecutedOn)
          that method will also forward the information to the iteration for update of autoset dates.
 void setReferencedDataset(Dataset referencedDataset)
           
 void setReferencedTestCase(TestCase referencedTestCase)
           
 void setTestSuites(List<TestSuite> testSuites)
           
 void setUser(User user)
           
 void updateExecutionStatus()
          the IterationTestPlanItem will fetch the ExecutionStatus of the last "live" Execution in his execution list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterationTestPlanItem

public IterationTestPlanItem()
Method Detail

getIteration

public Iteration getIteration()

getExecutionStatus

public ExecutionStatus getExecutionStatus()
Specified by:
getExecutionStatus in interface HasExecutionStatus

getLegalStatusSet

public Set<ExecutionStatus> getLegalStatusSet()
Specified by:
getLegalStatusSet in interface HasExecutionStatus
Returns:
which ExecutionStatus are available for the implementor : among all ExecutionStatus available not all might be relevant for that entity. The given collection is unmodifiable.

setExecutionStatus

public void setExecutionStatus(ExecutionStatus executionStatus)

updateExecutionStatus

public void updateExecutionStatus()
the IterationTestPlanItem will fetch the ExecutionStatus of the last "live" Execution in his execution list


getReferencedTestCase

public TestCase getReferencedTestCase()

setReferencedTestCase

public void setReferencedTestCase(TestCase referencedTestCase)

getId

public Long getId()
Specified by:
getId in interface Identified

getExecutions

public List<Execution> getExecutions()

setLabel

public void setLabel(String label)

getLabel

public String getLabel()

getLastExecutedBy

public String getLastExecutedBy()

setLastExecutedBy

public void setLastExecutedBy(String lastExecutedBy)

getLastExecutedOn

public Date getLastExecutedOn()

setLastExecutedOn

public void setLastExecutedOn(Date lastExecutedOn)
that method will also forward the information to the iteration for update of autoset dates.


emptyExecutions

public void emptyExecutions()

addExecution

public void addExecution(@NotNull
                         Execution execution)

createExecution

public Execution createExecution()
                          throws TestPlanItemNotExecutableException
Creates an execution of this item and returns it.

WARNING

Will not check cyclic calls between the referenced test cases anymore (eg A calls B calls C calls A). You have been warned

Returns:
the new execution
Throws:
TestPlanItemNotExecutableException

createAutomatedExecution

public Execution createAutomatedExecution()
                                   throws TestPlanItemNotExecutableException
Throws:
TestPlanItemNotExecutableException

isAutomated

public boolean isAutomated()

removeExecution

public void removeExecution(Execution execution)

createCopy

public IterationTestPlanItem createCopy()
Factory method. Creates a copy of this object according to copy / paste rules.

Returns:
the copy, never null

getProject

public Project getProject()

getUser

public User getUser()

setUser

public void setUser(User user)

isExecutableThroughIteration

public boolean isExecutableThroughIteration()

isExecutableThroughTestSuite

public boolean isExecutableThroughTestSuite()
Returns:
true if (the item last execution with unexecuted step) or (item has no execution and is linked to a testCase).

isTestCaseDeleted

public boolean isTestCaseDeleted()
One should use isExecutableThroughIteration() in favor of this method.

Returns:

addTestSuite

public void addTestSuite(@NotNull
                         TestSuite suite)

removeTestSuite

public void removeTestSuite(TestSuite suite)

getTestSuites

public List<TestSuite> getTestSuites()

getTestSuiteNames

public String getTestSuiteNames()

setTestSuites

public void setTestSuites(List<TestSuite> testSuites)

getLatestExecution

public Execution getLatestExecution()
Returns:
the last Execution or null if there is none

getExecutionMode

public TestCaseExecutionMode getExecutionMode()

getReferencedDataset

public Dataset getReferencedDataset()

setReferencedDataset

public void setReferencedDataset(Dataset referencedDataset)

createTestPlanItems

public static Collection<IterationTestPlanItem> createTestPlanItems(TestCase testCase,
                                                                    Collection<Dataset> datasets)
Creates a collection of test plan items for the given test case and datasets. If datasets is an empty collection, will create an "unparameterized" item. Otherwise, this will create 1 item per dataset.

Parameters:
testCase -
datasets - collection of datasets, can be empty or null.
Returns:
a collection containing at least 1 item.

createUnparameterizedTestPlanItem

public static IterationTestPlanItem createUnparameterizedTestPlanItem(TestCase testCase)
Creates a test plan item for the given test case. the test plan item won't be parameterized (ie no dataset).

Parameters:
testCase -
Returns:


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.