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


Java StringEscapeUtils.escapeHtml3方法代碼示例

本文整理匯總了Java中org.apache.commons.lang3.StringEscapeUtils.escapeHtml3方法的典型用法代碼示例。如果您正苦於以下問題:Java StringEscapeUtils.escapeHtml3方法的具體用法?Java StringEscapeUtils.escapeHtml3怎麽用?Java StringEscapeUtils.escapeHtml3使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang3.StringEscapeUtils的用法示例。


在下文中一共展示了StringEscapeUtils.escapeHtml3方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepareBugDescriptionForBugCreation

import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
/**
 * Prepares the description of bug body. By adding build url, a nice header, a note and
 * excaptes html tags, json tags.
 *
 * @param description
 * @return
 */
private String prepareBugDescriptionForBugCreation(String description)
{
    description = "*[Automation failed tests]*\n" +
            "||Testcase failing|| Parameters||\n" +
            description + "\n" +
            System.getProperty(AUTO_CREATE_ADDITIONAL_DETAILS,
                    configuration.getProperty(AUTO_CREATE_ADDITIONAL_DETAILS, "")) + "\n" +
            "Build url: " + buildUrl;
    description = description + "\n\n\n" + "Note: This bug is created automatically by DolphinNG." +
            " Please do not edit summary line of the bug.";
    description = StringEscapeUtils.escapeHtml3(description);
    description = StringEscapeUtils.escapeHtml4(description);
    description = JSONObject.escape(description);
    return description;
}
 
開發者ID:basavaraj1985,項目名稱:DolphinNG,代碼行數:23,代碼來源:JIRAClient.java

示例2: addCommentToIssue

import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
/**
 * Adds a comment to the jira ticket
 *
 * @param jiraTicket - jira ticket id
 * @param comment    - comment to add
 * @return
 * @throws MalformedURLException
 */
public boolean addCommentToIssue(String jiraTicket, String comment) throws MalformedURLException
{
    URL request = new URL("https://" + configuration.getProperty(DEFECT_MGMT_HOST) +
            configuration.getProperty(BUG_API) + "/" + jiraTicket + "/comment");
    comment = comment + "\n\n\n" + "Test Run URL: " + buildUrl;
    comment = comment + "\n" + "Note: This comment is created automatically by DolphinNG.";
    comment = StringEscapeUtils.escapeHtml3(comment);
    comment = StringEscapeUtils.escapeHtml4(comment);
    comment = JSONObject.escape(comment);
    String payload =
            "{" +
                    "\"body\":" + "\"" + comment + "\"" +
                    "}";
    RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
    RequestSpecification given = RestAssured.given();
    given = given.header(authenticationHeader);
    Response response = given
            .contentType(CONTENT_TYPE_APPLICATION_JSON)
            .accept(CONTENT_TYPE_APPLICATION_JSON)
            .when().body(payload).post(request).then()
            .extract().response();
    LOG.info("JIRA ticket creation result--->  StatusCode=" +
            response.getStatusCode() + " status=" + response.getStatusLine() +
            " payload=" + payload +
            " Response=" + response.getBody().prettyPrint());
    return response.getStatusCode() == 201;
}
 
開發者ID:basavaraj1985,項目名稱:DolphinNG,代碼行數:36,代碼來源:JIRAClient.java


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