jetbrains.buildServer.tests
Class TestName

java.lang.Object
  extended by jetbrains.buildServer.tests.TestName
All Implemented Interfaces:
java.lang.Comparable<TestName>

public class TestName
extends java.lang.Object
implements java.lang.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:

Some suite: another: jetbrains.BuildServer.Class.test(params) Separator is SUITE_SEPARATOR ': ' Class refactored in 6.5 by Maxim Podkolzine (maxim.podkolzine@jetbrains.com).


Field Summary
static java.lang.String SUITE_SEPARATOR
           
 
Constructor Summary
TestName(java.lang.String testName)
           
 
Method Summary
 int compareTo(TestName n2)
           
 boolean equals(java.lang.Object o)
           
 boolean equalsByNameWithoutParameters(TestName that)
           
 java.lang.String getAsString()
          Returns full test name string as it was reported by the test runner
 java.lang.String getClassName()
          Returns test case class name or empty string
 TestGroupName getGroupName()
          Returns an object which describes packaging of this test (namely, full suite, package, class)
 java.lang.String getNameWithoutParameters()
          Returns test name with package and class but without parameters
 java.lang.String getNameWithoutSuite()
          Returns test name with package, class and parameters
 java.lang.String getPackageName()
          Returns the test package name.
 java.lang.String getParameters()
          Returns additional test parameters specified in test name, or empty string for no parameters
 java.lang.String getPrefix()
          Returns test prefix, which includes optional suite name and optional package of the test
 java.lang.String getPrefixWithSeparator()
          Return prefix, which includes suite name and package name.
 java.lang.String getShortName()
          Returns test name with class name
 java.lang.String getSuite()
          Returns test suite, which ends with ': ' if suite is presented.
 java.lang.String getTestClass()
          For java-like tests returns full class name of the test.
 java.lang.String getTestMethodName()
          Returns name of the test method or empty string
 java.lang.String getTestNameWithoutPrefix()
          Returns full test name, but without prefix
 java.lang.String getTestNameWithParameters()
          Returns test name with parameters without class and other parts
 int hashCode()
           
 boolean hasPackage()
          Returns true if this test has non-empty package name
 boolean isJavaLikeTestName()
          Returns true if test name conforms the specified format.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SUITE_SEPARATOR

@NonNls
public static final java.lang.String SUITE_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

TestName

public TestName(@NotNull
                java.lang.String testName)
Method Detail

getGroupName

@NotNull
public TestGroupName getGroupName()
Returns an object which describes packaging of this test (namely, full suite, package, class)

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.

Returns:
true if test name conforms the specified format

getTestClass

public java.lang.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 java.lang.String getShortName()
Returns test name with class name

Returns:
test name with class name

getPrefixWithSeparator

@NotNull
public java.lang.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: '

Returns:
see above

getPrefix

@NotNull
public java.lang.String getPrefix()
Returns test prefix, which includes optional suite name and optional package of the test

Returns:
test prefix, which includes optional suite name and optional package of the test

getSuite

@NotNull
public java.lang.String getSuite()
Returns test suite, which ends with ': ' if suite is presented. Returns empty string if not available

Returns:
test suite, which ends with ': ' if suite is presented. Returns empty string if not available
See Also:
getPrefixWithSeparator()

getPackageName

@NotNull
public java.lang.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

Returns:
true if this test has non-empty package name

getClassName

@NotNull
public java.lang.String getClassName()
Returns test case class name or empty string

Returns:
test case class name or empty string

getTestMethodName

@NotNull
public java.lang.String getTestMethodName()
Returns name of the test method or empty string

Returns:
name of the test method or empty string

getParameters

@NotNull
public java.lang.String getParameters()
Returns additional test parameters specified in test name, or empty string for no parameters

Returns:
additional test parameters specified in test name, or empty string for no parameters

getNameWithoutParameters

@NotNull
public java.lang.String getNameWithoutParameters()
Returns test name with package and class but without parameters

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 java.lang.String getNameWithoutSuite()
Returns test name with package, class and parameters

Returns:
see above
Since:
7.1

getTestNameWithParameters

public java.lang.String getTestNameWithParameters()
Returns test name with parameters without class and other parts

Returns:
test name with parameters without class and other parts

getAsString

@NotNull
public java.lang.String getAsString()
Returns full test name string as it was reported by the test runner

Returns:
full test name string as it was reported by the test runner

getTestNameWithoutPrefix

@NotNull
public java.lang.String getTestNameWithoutPrefix()
Returns full test name, but without prefix

Returns:
full test name, but without prefix
See Also:
getPrefixWithSeparator()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(TestName n2)
Specified by:
compareTo in interface java.lang.Comparable<TestName>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object