本文整理汇总了Java中org.testng.IResultMap.getAllResults方法的典型用法代码示例。如果您正苦于以下问题:Java IResultMap.getAllResults方法的具体用法?Java IResultMap.getAllResults怎么用?Java IResultMap.getAllResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testng.IResultMap
的用法示例。
在下文中一共展示了IResultMap.getAllResults方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resultDetail
import org.testng.IResultMap; //导入方法依赖的package包/类
private void resultDetail(IResultMap tests) {
for (ITestResult result : tests.getAllResults()) {
ITestNGMethod method = result.getMethod();
int methodId = getId(result);
String cname = method.getTestClass().getName();
m_out.println("<h2 id=\"m" + methodId + "\" name=\"m" + methodId + "\" >" + cname + ":"
+ method.getMethodName() + "</h2>");
Set<ITestResult> resultSet = tests.getResults(method);
generateForResult(result, method, resultSet.size());
m_out.println("<p class=\"totop\"><a href=\"#summary\">back to summary</a></p>");
}
}
示例2: resultDetail
import org.testng.IResultMap; //导入方法依赖的package包/类
private void resultDetail(IResultMap tests) {
for (ITestResult result : tests.getAllResults()) {
ITestNGMethod method = result.getMethod();
int methodId = getId(result);
String cname = method.getTestClass().getName();
m_out.println("<h2 id=\"m" + methodId + "\" name=\"m" + methodId + "\" >" + cname + ":" + method.getMethodName() + "</h2>");
Set<ITestResult> resultSet = tests.getResults(method);
generateForResult(result, method, resultSet.size());
m_out.println("<p class=\"totop\"><a href=\"#summary\">back to summary</a></p>");
}
}
示例3: hasFailedBefore
import org.testng.IResultMap; //导入方法依赖的package包/类
private boolean hasFailedBefore(IResultMap failureList, ITestResult passedResult) {
for (ITestResult result : failureList.getAllResults()) {
String failedTest =
result.getMethod().getRealClass().toString()+ "." + result.getMethod().getMethodName();
String passedTest = passedResult.getMethod().getRealClass().toString() + "." +
passedResult.getMethod().getMethodName();
if (failedTest.equals(passedTest) && methodParameterEqual(result, passedResult)) {
return true;
}
}
return false;
}
示例4: listTestResult
import org.testng.IResultMap; //导入方法依赖的package包/类
private ArrayList<ITestResult> listTestResult(IResultMap resultMap){
Set<ITestResult> results = resultMap.getAllResults();
return new ArrayList<ITestResult>(results);
}
示例5: listTestResult
import org.testng.IResultMap; //导入方法依赖的package包/类
private ArrayList<ITestResult> listTestResult(IResultMap resultMap){
Set<ITestResult> results = resultMap.getAllResults();
return new ArrayList<ITestResult>(results);
}
示例6: processTestResults
import org.testng.IResultMap; //导入方法依赖的package包/类
/**
* Creates EARL statements from the given test results. A test result is
* described by an Assertion resource. The TestResult and TestCase resources
* are linked to the Assertion in accord with the EARL schema; the latter is
* also linked to a TestRequirement.
*
* @param earl
* An RDF Model containing EARL statements.
* @param results
* The results of invoking a collection of test methods.
*/
void processTestResults(Model earl, IResultMap results) {
for (ITestResult tngResult : results.getAllResults()) {
// create earl:Assertion
long endTime = tngResult.getEndMillis();
GregorianCalendar calTime = new GregorianCalendar(TimeZone.getDefault());
calTime.setTimeInMillis(endTime);
Resource assertion = earl.createResource("assert-" + ++this.resultCount,
EARL.Assertion);
assertion.addProperty(EARL.mode, EARL.AutomaticMode);
assertion.addProperty(EARL.assertedBy, this.assertor);
assertion.addProperty(EARL.subject, this.testSubject);
// link earl:TestResult to earl:Assertion
Resource earlResult = earl.createResource("result-" + this.resultCount,
EARL.TestResult);
earlResult.addProperty(DCTerms.date, earl.createTypedLiteral(calTime));
switch (tngResult.getStatus()) {
case ITestResult.FAILURE:
earlResult.addProperty(DCTerms.description, getDetailMessage(tngResult));
if (AssertionError.class.isInstance(tngResult.getThrowable())) {
earlResult.addProperty(EARL.outcome, EARL.Fail);
} else { // an exception occurred
earlResult.addProperty(EARL.outcome, EARL.CannotTell);
}
processResultAttributes(earlResult, tngResult);
break;
case ITestResult.SKIP:
earlResult.addProperty(DCTerms.description, getDetailMessage(tngResult));
earlResult.addProperty(EARL.outcome, EARL.NotTested);
break;
default:
earlResult.addProperty(EARL.outcome, EARL.Pass);
break;
}
assertion.addProperty(EARL.result, earlResult);
// link earl:TestCase to earl:Assertion and earl:TestRequirement
String testMethodName = tngResult.getMethod().getMethodName();
String testClassName = tngResult.getTestClass().getName().replaceAll("\\.", "/");
StringBuilder testCaseId = new StringBuilder(testClassName);
testCaseId.append('#').append(testMethodName);
Resource testCase = earl.createResource(testCaseId.toString(), EARL.TestCase);
testCase.addProperty(DCTerms.title, breakIntoWords(testMethodName));
String testDescr = tngResult.getMethod().getDescription();
if (null != testDescr && !testDescr.isEmpty()) {
testCase.addProperty(DCTerms.description, testDescr);
}
assertion.addProperty(EARL.test, testCase);
String testReqName = tngResult.getTestContext().getName().replaceAll("\\s", "-");
earl.createResource(testReqName).addProperty(DCTerms.hasPart, testCase);
}
}