本文整理匯總了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;
}
}