Class TestCase


  • public class TestCase
    extends Object
    Represents a unit test case. Has a couple of data items like name, status, time etc. associated. Reports testcase details in sonar-conform XML
    • Constructor Detail

      • TestCase

        public TestCase​(String name,
                        int time,
                        String status,
                        String stack,
                        String msg,
                        @Nullable
                        String file,
                        @Nullable
                        String testClassname)
        Constructs a testcase instance out of following parameters
        Parameters:
        name - The name of this testcase
        time - The execution time in milliseconds
        status - The execution status of the testcase
        stack - The stack trace occurred while executing of this testcase; pass "" if the testcase passed/skipped.
        msg - The error message associated with this testcase of the execution was erroneous; pass "" if not.
        file - The optional file to which this test case applies.
        testClassname - The classname of the test.
    • Method Detail

      • isError

        public boolean isError()
        Returns true if this testcase is an error, false otherwise
      • isFailure

        public boolean isFailure()
        Returns true if this testcase is a failure, false otherwise
      • isSkipped

        public boolean isSkipped()
        Returns true if this testcase has been skipped, failure, false otherwise
      • getTime

        public int getTime()
      • getDetails

        public String getDetails()
        Returns execution details as sonar-conform XML