Class Testcase


  • public class Testcase
    extends java.lang.Object
    A testcase consists of an component type to test and the result reports.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int cnt
      The number of tests to be performed.
      protected long duration
      The time needed to perform the test.
      static java.lang.String PROPERTY_TEST_TIMEOUT
      The name of the property for defining a test timeout.
      protected TestReport[] reports
      The test reports.
    • Constructor Summary

      Constructors 
      Constructor Description
      Testcase()
      Create a new testcase.
      Testcase​(int cnt)
      Create a new testcase.
      Testcase​(int cnt, TestReport[] reports)
      Create a testcase which is already performed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addReport​(TestReport report)
      Add a report.
      long getDuration()
      Get the test duration.
      java.lang.String getHTMLFragment​(int number, java.lang.String name)
      Create an HTML representation of this element that can be included in an HTML document.
      TestReport[] getReports()
      Get the reports.
      int getTestCount()
      Get the test count.
      boolean isPerformed()
      Check if this test case has been performed and is finished.
      boolean isSucceeded()
      Have all component tests succeeded.
      void setDuration​(long duration)
      Get the test duration.
      void setReports​(TestReport[] reports)
      Set the reports.
      void setTestCount​(int cnt)
      Set the test count.
      java.lang.String toString()
      Returns a string representation of the object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • PROPERTY_TEST_TIMEOUT

        public static final java.lang.String PROPERTY_TEST_TIMEOUT
        The name of the property for defining a test timeout.
        See Also:
        Constant Field Values
      • cnt

        protected int cnt
        The number of tests to be performed.
      • reports

        protected TestReport[] reports
        The test reports.
      • duration

        protected long duration
        The time needed to perform the test.
    • Constructor Detail

      • Testcase

        public Testcase()
        Create a new testcase.
      • Testcase

        public Testcase​(int cnt)
        Create a new testcase.
      • Testcase

        public Testcase​(int cnt,
                        TestReport[] reports)
        Create a testcase which is already performed.
    • Method Detail

      • getTestCount

        public int getTestCount()
        Get the test count.
        Returns:
        The test count.
      • setTestCount

        public void setTestCount​(int cnt)
        Set the test count.
        Parameters:
        cnt - The test count.
      • getDuration

        public long getDuration()
        Get the test duration.
        Returns:
        The test duration.
      • setDuration

        public void setDuration​(long duration)
        Get the test duration.
      • getReports

        public TestReport[] getReports()
        Get the reports.
        Returns:
        The reports.
      • addReport

        public void addReport​(TestReport report)
        Add a report.
        Parameters:
        report - The report.
      • setReports

        public void setReports​(TestReport[] reports)
        Set the reports.
        Parameters:
        reports - The reports.
      • isSucceeded

        public boolean isSucceeded()
        Have all component tests succeeded.
      • isPerformed

        public boolean isPerformed()
        Check if this test case has been performed and is finished.
      • toString

        public java.lang.String toString()
        Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the object.
      • getHTMLFragment

        public java.lang.String getHTMLFragment​(int number,
                                                java.lang.String name)
        Create an HTML representation of this element that can be included in an HTML document.
        Parameters:
        number - The number of the testcase (when displayed in a longer list), -1 for no number.
        name - The name of the testcase (when displayed in a longer list), null for no name.