當前位置: 首頁>>代碼示例>>Java>>正文


Java ITestResult.SUCCESS屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:pradeeptaswain,項目名稱:oldmonk,代碼行數:26,代碼來源:ReporterAPI.java

示例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>");
	}
}
 
開發者ID:quanqinle,項目名稱:WebAndAppUITesting,代碼行數:55,代碼來源:PowerEmailableReporter.java


注:本文中的org.testng.ITestResult.SUCCESS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。