Package jetbrains.buildServer.tests
Class TestName
- java.lang.Object
-
- jetbrains.buildServer.tests.TestName
-
- All Implemented Interfaces:
Comparable<TestName>
public class TestName extends Object implements Comparable<TestName>
Represents a test name with suite prefix. If test name matches the following format:<package name>[.:]<class name>[.:]<test method name>(<additional parameters for data-driven tests>)
then additional parameters are available:- <package name> - name of the package, does not contain spaces
- <class name> - test class name, does not contain spaces
- <test method name> - test method name, does not contain spaces
- <additional parameters for data-driven tests> - may contain any characters
Some suite: another: jetbrains.BuildServer.Class.test(params) Separator is SUITE_SEPARATOR ': '
NOTE: If the reported test name doesn't match the format above, TC will not be able to parse it and the parts (package name, class name, method name) will remain unset.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SUITE_SEPARATOR
-
Constructor Summary
Constructors Constructor Description TestName(String testName)
TestName(String testName, StringPoolInstance stringPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TestName n2)
boolean
equals(Object o)
boolean
equalsByNameWithoutParameters(TestName that)
String
getAsString()
Returns full test name string as it was reported by the test runnerString
getClassName()
Returns test case class name or empty stringTestGroupName
getGroupName()
Returns an object which describes packaging of this test (namely, full suite, package, class)String
getNameWithoutParameters()
Returns test name with package and class but without parametersString
getNameWithoutSuite()
Returns test name with package, class and parametersString
getPackageName()
Returns the test package name.String
getParameters()
Returns additional test parameters specified in test name, or empty string for no parametersString
getPrefix()
Returns test prefix, which includes optional suite name and optional package of the testString
getPrefixWithSeparator()
Return prefix, which includes suite name and package name.String
getShortName()
Returns test name with class nameString
getSuite()
Returns test suite, which ends with ': ' if suite is presented.String
getSuiteWithoutSeparator()
Returns test suite or empty string if not available.String
getTestClass()
For java-like tests returns full class name of the test.String
getTestMethodName()
Returns name of the test method or empty stringString
getTestNameWithoutPrefix()
Returns full test name, but without prefixString
getTestNameWithParameters()
Returns test name with parameters without class and other partsint
hashCode()
boolean
hasPackage()
Returns true if this test has non-empty package nameboolean
isJavaLikeTestName()
Returns true if test name conforms the specified format.String
toString()
-
-
-
Field Detail
-
SUITE_SEPARATOR
@NonNls public static final String SUITE_SEPARATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TestName
public TestName(@NotNull String testName)
-
TestName
public TestName(@NotNull String testName, @NotNull StringPoolInstance stringPool)
-
-
Method Detail
-
getGroupName
@NotNull public TestGroupName getGroupName()
Returns an object which describes packaging of this test (namely, full suite, package, class)- Since:
- 4.5
-
isJavaLikeTestName
public boolean isJavaLikeTestName()
Returns true if test name conforms the specified format.
-
getTestClass
public String getTestClass()
For java-like tests returns full class name of the test. For non java-like tests returns empty string.- Returns:
- empty string or full class name of the test (including package name).
-
getShortName
@NotNull public String getShortName()
Returns test name with class name
-
getPrefixWithSeparator
@NotNull public String getPrefixWithSeparator()
Return prefix, which includes suite name and package name. Suite name ends with separator ': '. Examples: 'suite name: jetbrains.buildserver' , 'jetbrains.buildserver', 'suite: name: '
-
getPrefix
@NotNull public String getPrefix()
Returns test prefix, which includes optional suite name and optional package of the test
-
getSuite
@NotNull public String getSuite()
Returns test suite, which ends with ': ' if suite is presented. Returns empty string if not available- See Also:
getPrefixWithSeparator()
-
getSuiteWithoutSeparator
@NotNull public String getSuiteWithoutSeparator()
Returns test suite or empty string if not available.- Since:
- 2021.1
- See Also:
getSuite()
-
getPackageName
@NotNull public String getPackageName()
Returns the test package name.- Returns:
- test package, or empty string if it is not available
-
hasPackage
public boolean hasPackage()
Returns true if this test has non-empty package name
-
getClassName
@NotNull public String getClassName()
Returns test case class name or empty string
-
getTestMethodName
@NotNull public String getTestMethodName()
Returns name of the test method or empty string
-
getParameters
@NotNull public String getParameters()
Returns additional test parameters specified in test name, or empty string for no parameters
-
getNameWithoutParameters
@NotNull public String getNameWithoutParameters()
Returns test name with package and class but without parameters
-
equalsByNameWithoutParameters
public boolean equalsByNameWithoutParameters(@NotNull TestName that)
- Parameters:
that
- another test name- Returns:
- true, iff "getNameWithoutParameters().equals(that.getNameWithoutParameters())"
-
getNameWithoutSuite
@NotNull public String getNameWithoutSuite()
Returns test name with package, class and parameters- Since:
- 7.1
-
getTestNameWithParameters
public String getTestNameWithParameters()
Returns test name with parameters without class and other parts
-
getAsString
@NotNull public String getAsString()
Returns full test name string as it was reported by the test runner
-
getTestNameWithoutPrefix
@NotNull public String getTestNameWithoutPrefix()
Returns full test name, but without prefix- See Also:
getPrefixWithSeparator()
-
compareTo
public int compareTo(TestName n2)
- Specified by:
compareTo
in interfaceComparable<TestName>
-
-