KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > common > StringTestCase


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.common;
10
11 import junit.framework.TestCase;
12 import org.jboss.portal.common.util.Tools;
13
14 /**
15  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
16  * @version $Revision: 1.1 $
17  */

18 public class StringTestCase extends TestCase
19 {
20
21    public StringTestCase(String JavaDoc name)
22    {
23       super(name);
24    }
25
26    public void testReplace()
27    {
28       assertEquals("", Tools.replace("", "abc", "def"));
29       assertEquals("defg", Tools.replace("abc", "abc", "defg"));
30       assertEquals("_defg_", Tools.replace("_abc_", "abc", "defg"));
31       assertEquals("_defgdefg_", Tools.replace("_abcabc_", "abc", "defg"));
32       assertEquals("_defg_defg_", Tools.replace("_abc_abc_", "abc", "defg"));
33    }
34
35 }
36
Popular Tags