org.squashtest.csp.tm.domain.requirement
Class RequirementVersion

java.lang.Object
  extended by org.squashtest.csp.tm.domain.resource.Resource
      extended by org.squashtest.csp.tm.domain.requirement.RequirementVersion
All Implemented Interfaces:
AttachmentHolder

@Entity
public class RequirementVersion
extends Resource
implements AttachmentHolder

Represents a version of a requirement.

Author:
Gregory Fouquet

Constructor Summary
RequirementVersion()
           
 
Method Summary
 void addVerifyingTestCase(TestCase testCase)
           
static RequirementVersion createFromMemento(RequirementVersionImportMemento memento)
          Factory methiod which creates a RequirementVersion from a memento objet which holds the new object's target state.
 AttachmentList getAttachmentList()
          Should return the container for this object's attachments.
 RequirementCategory getCategory()
           
 RequirementCriticality getCriticality()
           
 String getReference()
           
 Requirement getRequirement()
           
 RequirementStatus getStatus()
           
 Set<TestCase> getVerifyingTestCases()
          Returns an UNMODIFIABLE VIEW of the verifying test cases.
 int getVersionNumber()
           
 boolean isLinkable()
           
 boolean isModifiable()
          Tells if this requirement's "intrinsic" properties can be modified.
 boolean isNotObsolete()
           
 void notifyNoLongerVerifiedBy(TestCase testCase)
           
 void notifyVerifiedBy(TestCase testCase)
           
 void removeVerifyingTestCase(TestCase testCase)
           
 void setCategory(RequirementCategory category)
          Set the requirement category
 void setCriticality(RequirementCriticality criticality)
          Set the requirement criticality
 void setDescription(String description)
           
 void setName(String name)
           
 void setReference(String reference)
          Set the requirement reference
 void setStatus(RequirementStatus status)
          Sets this object's status, following status transition rules.
protected  void setVersionNumber(int versionNumber)
           
 
Methods inherited from class org.squashtest.csp.tm.domain.resource.Resource
getDescription, getId, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequirementVersion

public RequirementVersion()
Method Detail

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.
See Also:
AttachmentHolder.getAttachmentList()

setName

public void setName(String name)
Overrides:
setName in class Resource

setDescription

public void setDescription(String description)
Overrides:
setDescription in class Resource

getVerifyingTestCases

public Set<TestCase> getVerifyingTestCases()
Returns an UNMODIFIABLE VIEW of the verifying test cases.


addVerifyingTestCase

public void addVerifyingTestCase(@NotNull
                                 TestCase testCase)
                          throws RequirementVersionNotLinkableException,
                                 RequirementAlreadyVerifiedException
Parameters:
testCase -
Throws:
RequirementVersionNotLinkableException
RequirementAlreadyVerifiedException - if another version of the same requirement is already verified by this test case.

removeVerifyingTestCase

public void removeVerifyingTestCase(@NotNull
                                    TestCase testCase)
                             throws RequirementVersionNotLinkableException
Throws:
RequirementVersionNotLinkableException

getReference

public String getReference()
Returns:
the reference of the requirement

setReference

public void setReference(String reference)
Set the requirement reference

Parameters:
reference -

getCriticality

public RequirementCriticality getCriticality()
Returns:
the requirement criticality

setCriticality

public void setCriticality(RequirementCriticality criticality)
Set the requirement criticality

Parameters:
criticality -

getCategory

public RequirementCategory getCategory()
Returns:
the requirement category

setCategory

public void setCategory(RequirementCategory category)
Set the requirement category

Parameters:
category -

setStatus

public void setStatus(RequirementStatus status)
Sets this object's status, following status transition rules.

Parameters:
status -

getStatus

public RequirementStatus getStatus()

isLinkable

public boolean isLinkable()
Returns:
true if this requirement can be (un)linked by new verifying testcases

isModifiable

public boolean isModifiable()
Tells if this requirement's "intrinsic" properties can be modified. The following are not considered as "intrinsic" properties" : verifyingTestCases are governed by the isLinkable() state, status is governed by itself.

Returns:
true if this requirement's properties can be modified.

notifyVerifiedBy

public void notifyVerifiedBy(@NotNull
                             TestCase testCase)

notifyNoLongerVerifiedBy

public void notifyNoLongerVerifiedBy(@NotNull
                                     TestCase testCase)

getRequirement

public Requirement getRequirement()
Returns:
the requirement

getVersionNumber

public int getVersionNumber()
Returns:
the versionNumber

setVersionNumber

protected void setVersionNumber(int versionNumber)

isNotObsolete

public boolean isNotObsolete()

createFromMemento

public static RequirementVersion createFromMemento(@NotNull
                                                   RequirementVersionImportMemento memento)
Factory methiod which creates a RequirementVersion from a memento objet which holds the new object's target state. This method overrides any RequirementStatus workflow check.

Parameters:
memento -
Returns:


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