本文整理汇总了Java中org.testng.ITestResult.SUCCESS属性的典型用法代码示例。如果您正苦于以下问题:Java ITestResult.SUCCESS属性的具体用法?Java ITestResult.SUCCESS怎么用?Java ITestResult.SUCCESS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.testng.ITestResult
的用法示例。
在下文中一共展示了ITestResult.SUCCESS属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMethodExecutionStatus
public String getMethodExecutionStatus(String testName, String methodName)
{
Iterator<ITestResult> it2 = getMethodResults(testName, methodName).iterator();
String executionStatus = null;
while (it2.hasNext())
{
ITestResult result = it2.next();
if (result.getStatus() == ITestResult.SUCCESS)
{
executionStatus = "PASS";
} else if (result.getStatus() == ITestResult.FAILURE)
{
executionStatus = "FAIL";
} else if (result.getStatus() == ITestResult.SKIP)
{
executionStatus = "SKIP";
}
break;
}
return executionStatus;
}
示例2: generateForResult
private void generateForResult(ITestResult ans, ITestNGMethod method, int resultSetSize) {
Object[] parameters = ans.getParameters();
boolean hasParameters = parameters != null && parameters.length > 0;
if (hasParameters) {
tableStart("result", null);
m_out.print("<tr class=\"param\">");
for (int x = 1; x <= parameters.length; x++) {
m_out.print("<th>Parameter #" + x + "</th>");
}
m_out.println("</tr>");
m_out.print("<tr class=\"param stripe\">");
for (Object p : parameters) {
m_out.println("<td>" + Utils.escapeHtml(p.toString()) + "</td>");
}
m_out.println("</tr>");
}
List<String> msgs = Reporter.getOutput(ans);
boolean hasReporterOutput = msgs.size() > 0;
Throwable exception = ans.getThrowable();
boolean hasThrowable = exception != null;
if (hasReporterOutput || hasThrowable) {
if (hasParameters) {
m_out.print("<tr><td");
if (parameters.length > 1) {
m_out.print(" colspan=\"" + parameters.length + "\"");
}
m_out.println(">");
} else {
m_out.println("<div>");
}
if (hasReporterOutput) {
if (hasThrowable) {
m_out.println("<h3>Test Messages</h3>");
}
for (String line : msgs) {
m_out.println(line + "<br/>");
}
}
if (hasThrowable) {
boolean wantsMinimalOutput = ans.getStatus() == ITestResult.SUCCESS;
if (hasReporterOutput) {
m_out.println("<h3>" + (wantsMinimalOutput ? "Expected Exception" : "Failure") + "</h3>");
}
generateExceptionReport(exception, method);
}
if (hasParameters) {
m_out.println("</td></tr>");
} else {
m_out.println("</div>");
}
}
if (hasParameters) {
m_out.println("</table>");
}
}