⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stringutilstest.java

📁 一个功能较为完善的论坛
💻 JAVA
字号:
/*
 * XP Forum
 *
 * Copyright (c) 2002-2003 RedSoft Group.  All rights reserved.
 *
 */
package org.redsoft.forum.util;

import junit.framework.TestCase;

/**
 * Class Description here
 *
 * @author <a href="mailto:jwtronics@yahoo.com">John Wong</a>
 *
 * @version $Id: StringUtilsTest.java,v 1.1.1.1 2003/07/08 08:25:17 cinc Exp $
 */
public class StringUtilsTest extends TestCase {
	public StringUtilsTest(String theName) {
		super(theName);
	}

	public void testReplaceNewLine() {
		assertEquals("Null string", null, StringUtils.escapeHTMLTags(null));
		assertEquals("Escape < and >", "This is a test &lt;string&gt;.", StringUtils.escapeHTMLTags("This is a test <string>."));
	}

	public void testEscapeHTMLTags() {
		assertEquals("Null string", null, StringUtils.replaceNewLine(null));
		assertEquals("Escape new line", "This&nbsp;is&nbsp;a&nbsp;test&nbsp;<br>&nbsp;hehee.", StringUtils.replaceNewLine("This is a test \n hehee."));
	}

}//EOC

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -