org.testng.internal.Utils.escapeUnicode()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.testng.internal.Utils.escapeUnicode()方法的一些代码示例,展示了Utils.escapeUnicode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.escapeUnicode()方法的具体详情如下:
包路径:org.testng.internal.Utils
类名称:Utils
方法名:escapeUnicode

Utils.escapeUnicode介绍

暂无

代码示例

代码示例来源:origin: org.testng/testng

/**
 * Writes the content of the sb string to the file named filename in outDir encoding the output as UTF-8.
 * If outDir does not exist, it is created.
 *
 * @param outputDir the output directory (may not exist). If <tt>null</tt> then current directory is used.
 * @param fileName the filename
 * @param sb the file content
 */
public static void writeUtf8File(@Nullable String outputDir, String fileName, String sb) {
 final String outDirPath= outputDir != null ? outputDir : "";
 final File outDir= new File(outDirPath);
 writeFile(outDir, fileName, escapeUnicode(sb), "UTF-8");
}

代码示例来源:origin: cbeust/testng

/**
 * Writes the content of the sb string to the file named filename in outDir encoding the output as
 * UTF-8. If outDir does not exist, it is created.
 *
 * @param outputDir the output directory (may not exist). If <tt>null</tt> then current directory
 *     is used.
 * @param fileName the filename
 * @param sb the file content
 */
public static void writeUtf8File(@Nullable String outputDir, String fileName, String sb) {
 final String outDirPath = outputDir != null ? outputDir : "";
 final File outDir = new File(outDirPath);
 writeFile(outDir, fileName, escapeUnicode(sb), "UTF-8");
}

代码示例来源:origin: cbeust/testng

@Test
public void escapeUnicode() {
 assertEquals(Utils.escapeUnicode("test"), "test");
 assertEquals(
   Utils.escapeUnicode(String.valueOf(INVALID_CHAR)), String.valueOf(REPLACEMENT_CHAR));
}

相关文章