Package guru.mikelue.jdut.testng
Class TestNgResourceNaming
- java.lang.Object
-
- guru.mikelue.jdut.testng.TestNgResourceNaming
-
public final class TestNgResourceNaming extends Object
Provides generating of resource name by format string(
For example:MessageFormat
) and properties ofITestContext
,ITestNGMethod
, orISuite
.
// objISuite - The object of org.testng.ISuite String fileName = TestNgResourceNaming.naming("{1}", objISuite, ".yaml");
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
naming(String format, ISuite testSuite)
Generating naming byMessageFormat
andITestContext
.
The parameters for formatting: 0 -ISuite.getHost()
1 -ISuite.getName()
static String
naming(String format, ISuite testSuite, String suffix)
Generating naming byMessageFormat
,ITestContext
and suffix.
The parameters for formatting: 0 -ISuite.getHost()
1 -ISuite.getName()
static String
naming(String format, ITestContext testContext)
Generating naming byMessageFormat
andITestContext
.
The parameters for formatting: 0 -ITestContext.getName()
1 -ITestContext.getHost()
2 -ISuite.getName()
static String
naming(String format, ITestContext testContext, String suffix)
Generating naming byMessageFormat
,ITestContext
and suffix.
The parameters for formatting: 0 -ITestContext.getName()
1 -ITestContext.getHost()
2 -ISuite.getName()
static String
naming(String format, ITestNGMethod testNgMethod)
Generating naming byMessageFormat
andITestNGMethod
.
The parameters for formatting: 0 -Class.getName()
1 -Class.getSimpleName()
2 -Class.getTypeName()
3 -Class.getCanonicalName()
4 -Method.getName()
static String
naming(String format, ITestNGMethod testNgMethod, String suffix)
Generating naming byMessageFormat
,ITestNGMethod
and suffix.
The parameters for formatting: 0 -Class.getName()
1 -Class.getSimpleName()
2 -Class.getTypeName()
3 -Class.getCanonicalName()
4 -Method.getName()
-
-
-
Method Detail
-
naming
public static String naming(String format, ISuite testSuite)
Generating naming byMessageFormat
andITestContext
.
The parameters for formatting:- 0 -
ISuite.getHost()
- 1 -
ISuite.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testSuite
- The context of TestNG- Returns:
- formatted string
- 0 -
-
naming
public static String naming(String format, ISuite testSuite, String suffix)
Generating naming byMessageFormat
,ITestContext
and suffix.
The parameters for formatting:- 0 -
ISuite.getHost()
- 1 -
ISuite.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testSuite
- The context of TestNGsuffix
- The suffix of resource- Returns:
- formatted string
- 0 -
-
naming
public static String naming(String format, ITestContext testContext)
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testContext
- The context of TestNG- Returns:
- formatted string
-
naming
public static String naming(String format, ITestContext testContext, String suffix)
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testContext
- The context of TestNGsuffix
- The suffix of resource- Returns:
- formatted string
-
naming
public static String naming(String format, ITestNGMethod testNgMethod)
Generating naming byMessageFormat
andITestNGMethod
.
The parameters for formatting:- 0 -
Class.getName()
- 1 -
Class.getSimpleName()
- 2 -
Class.getTypeName()
- 3 -
Class.getCanonicalName()
- 4 -
Method.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testNgMethod
- The context of TestNG- Returns:
- formatted string
- 0 -
-
naming
public static String naming(String format, ITestNGMethod testNgMethod, String suffix)
Generating naming byMessageFormat
,ITestNGMethod
and suffix.
The parameters for formatting:- 0 -
Class.getName()
- 1 -
Class.getSimpleName()
- 2 -
Class.getTypeName()
- 3 -
Class.getCanonicalName()
- 4 -
Method.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
testNgMethod
- The context of TestNGsuffix
- The suffix of resource- Returns:
- formatted string
- 0 -
-
-