Interface Requirement

  • All Superinterfaces:
    IdentifiableRemote, java.rmi.Remote, TptRemote

    public interface Requirement
    extends IdentifiableRemote
    RMI representation of a requirement. This interface allows more manipulation than the user can do from the UI. The UI only allows globally removing an attribute and editing the comment.

    Note: Changing the requirement via API - in contrast to changing it by importing requirements - will not lead to a "modified" state of the requirement. Only UI actions that lead to a "modified" state will do so via API as well, e.g. setting status to "deleted". Otherwise use markAsModified() to set the status to modified explicitly.
    • Method Detail

      • getType

        Requirement.RequirementType getType()
                                     throws java.rmi.RemoteException
        Get the type of the requirement.
        Returns:
        The type of the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setType

        void setType​(Requirement.RequirementType type)
              throws java.rmi.RemoteException
        Set the type of the requirement.
        Parameters:
        type - The new type of the Requirement
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getID

        java.lang.String getID()
                        throws java.rmi.RemoteException
        Every requirement has a unique ID.
        Returns:
        The unique ID.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getDocument

        java.lang.String getDocument()
                              throws java.rmi.RemoteException
        A requirement normally belongs to a document. The default docmuent is an empty string.
        Returns:
        The name of the document the requirement belongs to.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getDocumentVersion

        java.lang.String getDocumentVersion()
                                     throws java.rmi.RemoteException
        Get the document version of the requirement.
        Returns:
        The requirement's document version.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getModule

        @Deprecated
        java.lang.String getModule()
                            throws java.rmi.RemoteException
        Deprecated.
        Use getDocument() instead. Will be removed in TPT-18.
        A requirement normally belongs to a module. The default module is an empty string.
        Returns:
        The name of the module the requirement belongs to.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getText

        java.lang.String getText()
                          throws java.rmi.RemoteException
        Get the describing text a requirement normally has.
        Returns:
        The describing text of the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setText

        void setText​(java.lang.String text)
              throws java.rmi.RemoteException
        Set the describing text a requirement normally has.
        Parameters:
        text - The new describing text. Null will be reduced to an empty string.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getComment

        java.lang.String getComment()
                             throws java.rmi.RemoteException
        Get the comment of the requirement. This comment is also editable from the UI.
        Returns:
        The comment of the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setComment

        void setComment​(java.lang.String comment)
                 throws java.rmi.RemoteException
        Set the comment of the requirement. This comment is also editable from the UI.
        Parameters:
        comment - The new comment of the requirement. Null will be reduced to an empty string.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getURI

        java.net.URI getURI()
                     throws java.rmi.RemoteException
        Get the URI of the requirement. If a requirement has a URI a clickable link symbol will be displayed in the UI.
        Returns:
        The URI of the requirement or null.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setURI

        void setURI​(java.net.URI uri)
             throws java.rmi.RemoteException
        Set the URI of the requirement. If a requirement has a URI a clickable link symbol will be displayed in the UI.
        Parameters:
        uri - The new URI or null to remove the link.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getAttributes

        java.util.Map<java.lang.String,​java.lang.String> getAttributes()
                                                                      throws java.rmi.RemoteException
        Returns the attributes and the associated values of the requirement. A requirement can have additional attributes. Each attribute has a value associated for the requirement.
        Returns:
        A map from attribute name to value.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setAttribute

        void setAttribute​(java.lang.String attributeName,
                          java.lang.String value)
                   throws java.rmi.RemoteException
        Set the attribute value of the requirement. A requirement can have additional attributes. Each attribute has a value associated for the requirement. If the attribute does not exist yet it will be created. If you set the value to null the attribute will be removed. If you remove an attribute the associated attachments will be removed, too.
        Parameters:
        attributeName - the name of the attribute.
        value - The new value or null to remove the attribute from the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getRequirementAttachments

        RemoteList<Attachment> getRequirementAttachments()
                                                  throws java.rmi.RemoteException
        Delivers the list of attachments the requirement directly has. This list is shown in the UI as attachments to the attribute "Text". For attachments of other attributes see getAttributeAttachments(String).
        Returns:
        The List of attachments of the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • createRequirementAttachment

        Attachment createRequirementAttachment​(java.lang.String fileName,
                                               byte[] content)
                                        throws java.rmi.RemoteException
        Adds a new attachment to the list of attachments every requirement can have directly. This list is shown in the UI as attachments to the attribute "Text". For attachments of other attributes see createAttributeAttachment(String, String, byte[]).
        Parameters:
        fileName - The file name of the attachment. The file name is used to create temporary files when viewing the attachment and will be shown in the UI as tooltip in TPT.
        content - The content of the attachment.
        Returns:
        The newly created attachment
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getAttributeAttachments

        RemoteList<Attachment> getAttributeAttachments​(java.lang.String attributeName)
                                                throws java.rmi.RemoteException
        Delivers the list of attachments every requirement attribute can have. The default attributes "ID", "Text", "URI", and "Comment" cannot have attachments but attachments of the requirement (see getRequirementAttachments()) will be shown in the UI as attachments of "Text".
        Parameters:
        attributeName - The name of the attribute.
        Returns:
        The List of attachments of the given attribute. Returns null if the attribute is not defined for the requirement.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • createAttributeAttachment

        Attachment createAttributeAttachment​(java.lang.String attributeName,
                                             java.lang.String fileName,
                                             byte[] content)
                                      throws java.rmi.RemoteException
        Adds a new attachment to the list of attachments every requirement attribute can have. If no attribute with the given attribute name exists for the requirement the attribute will be created and an empty value associated. The default attributes "ID", "Text", "URI", and "Comment" cannot have attachments but attachments created with createRequirementAttachment(String, byte[]) will be shown as attachments of "Text".
        Parameters:
        attributeName - The name of the attribute.
        fileName - The file name of the attachment. The file name is used to create temporary files when viewing the attachment and will be shown as tooltip in TPT.
        content - The content of the attachment.
        Returns:
        The newly created attachment
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getLinkedAssessments

        RemoteCollection<Assessment> getLinkedAssessments()
                                                   throws java.rmi.RemoteException
        Get all assesslets linked to this requirement.
        Returns:
        The list of linked assessments.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • linkAssessment

        void linkAssessment​(AssessmentOrGroup aog)
                     throws ApiException,
                            java.rmi.RemoteException
        Creates a link between this requirement and the given Assessment. If the argument is a AssessmentGroup all assessments of the group will be added recursively. You can remove a link by removing the Assessment from getLinkedAssessments().
        Parameters:
        aog - The Assessment or AssessmentGroup to create links to this requirement.
        Throws:
        ApiException - If the type of the requirement is not linkable or if aog is not of the same project as the requirement.
        java.rmi.RemoteException - remote communication problem
      • getLinkedScenarios

        RemoteCollection<Scenario> getLinkedScenarios()
                                               throws java.rmi.RemoteException
        Get all test cases and variants linked to this requirement.
        Returns:
        The list of linked test cases and variants.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • linkScenario

        void linkScenario​(ScenarioOrGroup sog)
                   throws ApiException,
                          java.rmi.RemoteException
        Creates a link between this requirement and the given Scenario. If the argument is a ScenarioGroup all scenarios of the group will be added recursively. You can remove a link by removing the Scenario from getLinkedScenarios().
        Parameters:
        sog - The Scenario or ScenarioOrGroup to create links to this requirement.
        Throws:
        ApiException - If the type of the requirement is not linkable or if sog is not of the same project as the requirement.
        java.rmi.RemoteException - remote communication problem
      • setStatus

        void setStatus​(Requirement.RequirementStatus status)
                throws ApiException,
                       java.rmi.RemoteException
        Sets the requirement status.
        Parameters:
        status - to be set.
        Throws:
        ApiException - If the the given status is not allowed or null.
        java.rmi.RemoteException - remote communication problem
      • getStatus

        Requirement.RequirementStatus getStatus()
                                         throws java.rmi.RemoteException
        Returns the current requirement status.
        Returns:
        the current requirement status.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • markAsModified

        void markAsModified()
                     throws java.rmi.RemoteException
        Marks this requirement as modified.
        Throws:
        java.rmi.RemoteException - remote communication problem
        See Also:
        markAsReviewed()
      • markAsReviewed

        void markAsReviewed()
                     throws java.rmi.RemoteException
        Marks this requirement as reviewed.
        Throws:
        java.rmi.RemoteException - remote communication problem
        See Also:
        markAsModified()
      • isModified

        boolean isModified()
                    throws java.rmi.RemoteException
        Returns true if the requirement is marked as modified, otherwise false.
        Returns:
        true if requirement is marked as modified, otherwise false
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getLinkedTestCases

        java.util.Set<Scenario> getLinkedTestCases()
                                            throws java.rmi.RemoteException
        Returns all (explicit and implicit) to this Requirement linked test cases.
        Returns:
        all (explicit and implicit) to this Requirement linked test cases.
        Throws:
        java.rmi.RemoteException - remote communication problem