本文整理汇总了Java中org.testng.ITestResult.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ITestResult.getName方法的具体用法?Java ITestResult.getName怎么用?Java ITestResult.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testng.ITestResult
的用法示例。
在下文中一共展示了ITestResult.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retry
import org.testng.ITestResult; //导入方法依赖的package包/类
@Override
public boolean retry(ITestResult result) {
if (retryCount <= maxRetryCount) {
String message = "Retry for [" + result.getName() + "] on class [" + result.getTestClass().getName() + "] Retry "
+ retryCount + " times";
logger.info(message);
Reporter.setCurrentTestResult(result);
Reporter.log("RunCount=" + (retryCount + 1));
retryCount++;
return true;
}
return false;
}
示例2: getTestName
import org.testng.ITestResult; //导入方法依赖的package包/类
private String getTestName(
ITestResult result ) {
String testName = result.getName();
// check if there is a description annotation and get the test name
Method testCaseMethod = result.getMethod().getConstructorOrMethod().getMethod();
Description testCaseDescription = testCaseMethod.getAnnotation(Description.class);
if (testCaseDescription != null && testCaseDescription.name().length() > 0) {
testName = testCaseDescription.name();
}
return testName;
}
示例3: getTestName
import org.testng.ITestResult; //导入方法依赖的package包/类
private String getTestName( ITestResult result ) {
String testName = result.getName();
// check if there is a description annotation and get the test name
Method testCaseMethod = result.getMethod().getConstructorOrMethod().getMethod();
Description testCaseDescription = testCaseMethod.getAnnotation(Description.class);
if (testCaseDescription != null && testCaseDescription.name().length() > 0) {
testName = testCaseDescription.name();
}
return testName;
}
示例4: getArtifactBaseName
import org.testng.ITestResult; //导入方法依赖的package包/类
/**
* Get base name for artifact files for the specified test result.
* <br><br>
* <b>NOTE</b>: The base name is derived from the name of the current test.
* If the method is parameterized, a hash code is computed from the parameter
* values and appended to the base name as an 8-digit hexadecimal integer.
*
* @param result TestNG test result object
* @return artifact file base name
*/
private static String getArtifactBaseName(ITestResult result) {
Object[] parameters = result.getParameters();
if (parameters.length == 0) {
return result.getName();
} else {
int hashcode = Arrays.deepHashCode(parameters);
String hashStr = String.format("%08X", hashcode);
return result.getName() + "-" + hashStr;
}
}