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

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

@Entity
public class Iteration
extends Object
implements AttachmentHolder, NodeContainer<TestSuite>, TreeNode, Copiable, org.squashtest.csp.core.domain.Identified, BoundEntity


Constructor Summary
Iteration()
           
 
Method Summary
 void accept(NodeVisitor visitor)
           
 void addContent(TestSuite testSuite)
          Adds new content to this container.
 void addTestPlan(IterationTestPlanItem testPlan)
           
 void addTestSuite(TestSuite suite)
           
 boolean checkSuiteNameAvailable(String name)
           
 Iteration createCopy()
           copy of iteration doesn't contain test-suites !!
 Map<TestSuite,List<Integer>> createTestSuitesPastableCopy()
          this method is used in case of copy paste of an iteration with test suites.
 int findItemIndexInTestPlan(long testPlanId)
          Method which returns the position of an item test plan in the current iteration
 int findTestCaseIndexInTestPlan(long testCaseId)
          Method which returns the position of a test case in the current iteration
 Date getActualEndDate()
           
 Date getActualStartDate()
           
 AttachmentList getAttachmentList()
          Should return the container for this object's attachments.
 Long getBoundEntityId()
           
 BindableEntity getBoundEntityType()
           
 Campaign getCampaign()
           
 CampaignLibrary getCampaignLibrary()
           
 Set getContent()
           
 List<String> getContentNames()
           
 String getDescription()
           
 List<Execution> getExecutions()
          flattened list of the executions
 Long getId()
           
 int getIndexOf(IterationTestPlanItem item)
           
 String getName()
           
 List<TestCase> getPlannedTestCase()
           
 Project getProject()
           
 Date getScheduledEndDate()
           
 Date getScheduledStartDate()
           
 IterationTestPlanItem getTestPlan(Long testPlanId)
           
 List<IterationTestPlanItem> getTestPlans()
           
 Set<TestSuite> getTestSuites()
           
 boolean hasContent()
           
 boolean hasTestSuites()
           
 boolean isActualEndAuto()
           
 boolean isActualStartAuto()
           
 boolean isContentNameAvailable(String name)
           
 void moveTestPlan(int currentPosition, int newPosition)
          Deprecated. 
 void moveTestPlans(int newIndex, List<IterationTestPlanItem> movedItems)
           
 void removeContent(TestSuite contentToRemove)
           
 void removeTestPlan(IterationTestPlanItem testPlan)
           
 void removeTestSuite(TestSuite testSuite)
           
 void setActualEndAuto(boolean actualEndAuto)
           
 void setActualEndDate(Date endDate)
           
 void setActualStartAuto(boolean actualStartAuto)
           
 void setActualStartDate(Date startDate)
           
 void setDescription(String description)
           
 void setName(String name)
           
 void setScheduledEndDate(Date endDate)
           
 void setScheduledStartDate(Date startDate)
           
 void updateAutoDates(Date newItemTestPlanDate)
          If the iteration have autodates set, they will be updated accordingly.
 void updateAutoDatesAfterExecutionDetach(IterationTestPlanItem iterationTestPlanItem, Execution execution)
          will update acual end and start dates if are auto and if they were driven by the execution last-executed on
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iteration

public Iteration()
Method Detail

getExecutions

public List<Execution> getExecutions()
flattened list of the executions


setName

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

getName

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

getCampaign

public Campaign getCampaign()

setDescription

public void setDescription(String description)

getDescription

public String getDescription()

setScheduledStartDate

public void setScheduledStartDate(Date startDate)

getScheduledStartDate

public Date getScheduledStartDate()

setScheduledEndDate

public void setScheduledEndDate(Date endDate)

getScheduledEndDate

public Date getScheduledEndDate()

setActualStartDate

public void setActualStartDate(Date startDate)

getActualStartDate

public Date getActualStartDate()

setActualEndDate

public void setActualEndDate(Date endDate)

getActualEndDate

public Date getActualEndDate()

isActualStartAuto

public boolean isActualStartAuto()

isActualEndAuto

public boolean isActualEndAuto()

setActualStartAuto

public void setActualStartAuto(boolean actualStartAuto)

setActualEndAuto

public void setActualEndAuto(boolean actualEndAuto)

getId

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

getTestPlan

public IterationTestPlanItem getTestPlan(Long testPlanId)

createCopy

public Iteration createCopy()

copy of iteration doesn't contain test-suites !!

Specified by:
createCopy in interface Copiable
Returns:

getTestPlans

public List<IterationTestPlanItem> getTestPlans()

getPlannedTestCase

public List<TestCase> getPlannedTestCase()

removeTestSuite

public void removeTestSuite(@NotNull
                            TestSuite testSuite)

removeTestPlan

public void removeTestPlan(@NotNull
                           IterationTestPlanItem testPlan)

addTestPlan

public void addTestPlan(@NotNull
                        IterationTestPlanItem testPlan)

findTestCaseIndexInTestPlan

public int findTestCaseIndexInTestPlan(long testCaseId)
Method which returns the position of a test case in the current iteration

Parameters:
testCaseId - the id of the test case we're looking for
Returns:
the position of the test case (int)
Throws:
UnknownEntityException - if not found.

findItemIndexInTestPlan

public int findItemIndexInTestPlan(long testPlanId)
Method which returns the position of an item test plan in the current iteration

Parameters:
testPlanId - the id of the test plan we're looking for
Returns:
the position of the test plan (int)
Throws:
UnknownEntityException - if not found.

moveTestPlan

@Deprecated
public void moveTestPlan(int currentPosition,
                                    int newPosition)
Deprecated. 

Method which sets a test case at a new position

Parameters:
currentPosition - the current position
newPosition - the new position

moveTestPlans

public void moveTestPlans(int newIndex,
                          List<IterationTestPlanItem> movedItems)

getIndexOf

public int getIndexOf(IterationTestPlanItem item)

getTestSuites

public Set<TestSuite> getTestSuites()

addTestSuite

public void addTestSuite(TestSuite suite)

checkSuiteNameAvailable

public boolean checkSuiteNameAvailable(String name)

hasTestSuites

public boolean hasTestSuites()

getAttachmentList

public AttachmentList getAttachmentList()
Description copied from interface: AttachmentHolder
Should return the container for this object's attachments. Should never return null.

Specified by:
getAttachmentList in interface AttachmentHolder
Returns:
the AttachmentList of this object.

getProject

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

getCampaignLibrary

public CampaignLibrary getCampaignLibrary()

updateAutoDates

public void updateAutoDates(Date newItemTestPlanDate)
If the iteration have autodates set, they will be updated accordingly.

Parameters:
newItemTestPlanDate -

createTestSuitesPastableCopy

public Map<TestSuite,List<Integer>> createTestSuitesPastableCopy()
this method is used in case of copy paste of an iteration with test suites.

Returns:
A map of test suite and indexes
One entry-set contains
  • a copied test suite (without it's test plan)
  • and the indexes of the copied test plan that are to be linked with it (taking into account test_plan_items that are test_case deleted)

updateAutoDatesAfterExecutionDetach

public void updateAutoDatesAfterExecutionDetach(IterationTestPlanItem iterationTestPlanItem,
                                                Execution execution)
will update acual end and start dates if are auto and if they were driven by the execution last-executed on

Parameters:
execution -

getBoundEntityId

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

getBoundEntityType

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

accept

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

addContent

public void addContent(@NotNull
                       TestSuite testSuite)
                throws DuplicateNameException,
                       org.apache.commons.lang.NullArgumentException
Description copied from interface: NodeContainer
Adds new content to this container. Should refuse to add null content, should refuse to add content with duplicate name.

Specified by:
addContent in interface NodeContainer<TestSuite>
Throws:
DuplicateNameException
org.apache.commons.lang.NullArgumentException

isContentNameAvailable

public boolean isContentNameAvailable(String name)
Specified by:
isContentNameAvailable in interface NodeContainer<TestSuite>

getContent

public Set getContent()
Specified by:
getContent in interface NodeContainer<TestSuite>

hasContent

public boolean hasContent()
Specified by:
hasContent in interface NodeContainer<TestSuite>

removeContent

public void removeContent(TestSuite contentToRemove)
                   throws org.apache.commons.lang.NullArgumentException
Specified by:
removeContent in interface NodeContainer<TestSuite>
Throws:
org.apache.commons.lang.NullArgumentException

getContentNames

public List<String> getContentNames()
Specified by:
getContentNames in interface NodeContainer<TestSuite>


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