org.squashtest.csp.tm.domain.campaign
Class TestSuite

java.lang.Object
  extended by org.squashtest.csp.tm.domain.campaign.TestSuite
All Implemented Interfaces:
org.squashtest.csp.core.domain.Identified, BoundEntity, Copiable, TreeNode

@Entity
public class TestSuite
extends Object
implements org.squashtest.csp.core.domain.Identified, Copiable, TreeNode, BoundEntity


Constructor Summary
TestSuite()
           
 
Method Summary
 void accept(NodeVisitor visitor)
           
 void bindTestPlanItems(List<IterationTestPlanItem> items)
          Binds the test plan items to this test suite
 void bindTestPlanItemsById(List<Long> itemIds)
          Binds the test plan items to this test suite using their id to retrieve them from the iteration.
 TestSuite createCopy()
           returns a copy of a test Suite without it's test plan.
 List<IterationTestPlanItem> createPastableCopyOfTestPlan()
           returns an ordered copy of the test-suite test plan
-test plans items that are not linked to a test case are not copied
-the copy of a test plan item is done using IterationTestPlanItem.createCopy()
 IterationTestPlanItem findFirstExecutableTestPlanItem()
           
 IterationTestPlanItem findNextExecutableTestPlanItem(long testPlanItemId)
          finds next item (that last execution has unexecuted step) or (has no execution and is not test case deleted) can return item linked to test-case with no step
 AttachmentList getAttachmentList()
           
 Long getBoundEntityId()
           
 BindableEntity getBoundEntityType()
           
 String getDescription()
           
 IterationTestPlanItem getFirstTestPlanItem()
           
 Long getId()
           
 Iteration getIteration()
           
 String getName()
           
 Project getProject()
           
 List<IterationTestPlanItem> getTestPlan()
          Warning : that property builds a new list every time.
 boolean isFirstExecutableTestPlanItem(long itemId)
          Determines if the item is the first of the test plan of the test suite
 boolean isLastExecutableTestPlanItem(long itemId)
           
 void rename(String newName)
           
 void reorderTestPlan(int newIndex, List<IterationTestPlanItem> movedItems)
          Since the test plan of a TestSuite is merely a view on the backing iteration, we will reorder here the test plan accordingly.
 void setDescription(String description)
           
 void setName(String name)
           
 void unBindTestPlan(List<IterationTestPlanItem> items)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSuite

public TestSuite()
Method Detail

getId

public Long getId()
Specified by:
getId in interface org.squashtest.csp.core.domain.Identified

getName

public String getName()
Specified by:
getName in interface Copiable

setName

public void setName(String name)
Specified by:
setName in interface Copiable

rename

public void rename(String newName)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getIteration

public Iteration getIteration()

getAttachmentList

public AttachmentList getAttachmentList()

getTestPlan

public List<IterationTestPlanItem> getTestPlan()
Warning : that property builds a new list every time. If you want to change the content of the list, use the other dedicated accessors ( #addTestPlan(List)) or the other one)

Returns:

getFirstTestPlanItem

public IterationTestPlanItem getFirstTestPlanItem()

bindTestPlanItems

public void bindTestPlanItems(List<IterationTestPlanItem> items)
Binds the test plan items to this test suite

Parameters:
items -

unBindTestPlan

public void unBindTestPlan(List<IterationTestPlanItem> items)

bindTestPlanItemsById

public void bindTestPlanItemsById(List<Long> itemIds)
Binds the test plan items to this test suite using their id to retrieve them from the iteration.

Parameters:
itemIds -

reorderTestPlan

public void reorderTestPlan(int newIndex,
                            List<IterationTestPlanItem> movedItems)
Since the test plan of a TestSuite is merely a view on the backing iteration, we will reorder here the test plan accordingly. For instance if the newIndex is x in the TS test plan, Ix being the item at position x in the TS test plan, we will place the moved items at position y in Iteration test plan where y is the position of Ix in the Iteration test plan.


createPastableCopyOfTestPlan

public List<IterationTestPlanItem> createPastableCopyOfTestPlan()

returns an ordered copy of the test-suite test plan
-test plans items that are not linked to a test case are not copied
-the copy of a test plan item is done using IterationTestPlanItem.createCopy()

Returns:
an ordered copy of the test-suite test plan

createCopy

public TestSuite createCopy()

returns a copy of a test Suite without it's test plan.
a copy of the test plan can be found at createPastableCopyOfTestPlan()

Specified by:
createCopy in interface Copiable
Returns:
returns a copy of a test Suite

isLastExecutableTestPlanItem

public boolean isLastExecutableTestPlanItem(long itemId)

isFirstExecutableTestPlanItem

public boolean isFirstExecutableTestPlanItem(long itemId)
Determines if the item is the first of the test plan of the test suite


findNextExecutableTestPlanItem

public IterationTestPlanItem findNextExecutableTestPlanItem(long testPlanItemId)
finds next item (that last execution has unexecuted step) or (has no execution and is not test case deleted) can return item linked to test-case with no step

Parameters:
testPlanItemId -
Throws:
TestPlanItemNotExecutableException - if no item is found
IllegalArgumentException - if id does not correspond to an item of the test suite

findFirstExecutableTestPlanItem

public IterationTestPlanItem findFirstExecutableTestPlanItem()
Returns:
Throws:
{@link - TestPlanItemNotExecutableException}
{@link - EmptyTestSuiteTestPlanException}

getBoundEntityId

public Long getBoundEntityId()
Specified by:
getBoundEntityId in interface BoundEntity

getBoundEntityType

public BindableEntity getBoundEntityType()
Specified by:
getBoundEntityType in interface BoundEntity

getProject

public Project getProject()
Specified by:
getProject in interface BoundEntity

accept

public void accept(NodeVisitor visitor)
Specified by:
accept in interface TreeNode


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