Package org.sonar.plugins.python.xunit
Class TestCase
- java.lang.Object
-
- org.sonar.plugins.python.xunit.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTATUS_ERRORstatic StringSTATUS_FAILUREstatic StringSTATUS_OKstatic StringSTATUS_SKIPPED
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDetails()Returns execution details as sonar-conform XMLStringgetFile()StringgetTestClassname()intgetTime()booleanisError()Returns true if this testcase is an error, false otherwisebooleanisFailure()Returns true if this testcase is a failure, false otherwisebooleanisSkipped()Returns true if this testcase has been skipped, failure, false otherwise
-
-
-
Field Detail
-
STATUS_OK
public static final String STATUS_OK
- See Also:
- Constant Field Values
-
STATUS_ERROR
public static final String STATUS_ERROR
- See Also:
- Constant Field Values
-
STATUS_FAILURE
public static final String STATUS_FAILURE
- See Also:
- Constant Field Values
-
STATUS_SKIPPED
public static final String STATUS_SKIPPED
- See Also:
- Constant Field Values
-
-
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 testcasetime- The execution time in millisecondsstatus- The execution status of the testcasestack- 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()
-
getFile
@CheckForNull public String getFile()
-
getTestClassname
@CheckForNull public String getTestClassname()
-
getDetails
public String getDetails()
Returns execution details as sonar-conform XML
-
-