KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > util > StringHelperTest


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2006 EBM Websourcing
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: StringHelperTest.java 98 2006-02-24 16:18:48Z alouis $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.util;
23
24 import junit.framework.TestCase;
25
26 /**
27  *
28  * @version $Rev: 98 $ $Date: 2006-02-24 17:18:48 +0100 (ven., 24 févr. 2006) $
29  * @since Petals 1.0
30  * @author Adrien LOUIS
31  */

32 public class StringHelperTest extends TestCase {
33
34     /*
35      * Test method for 'org.objectweb.petals.util.StringHelper.isEmpty(String)'
36      */

37     public void testIsEmpty1() {
38         assertTrue(StringHelper.isEmpty(null));
39     }
40
41     public void testIsEmpty2() {
42         assertTrue(StringHelper.isEmpty(""));
43     }
44
45     public void testIsEmpty3() {
46         assertFalse(StringHelper.isEmpty("a"));
47     }
48
49     /*
50      * Test method for 'org.objectweb.petals.util.StringHelper.equal(String,
51      * String)'
52      */

53     public void testEqual1() {
54         assertTrue(StringHelper.equal(null, null));
55     }
56
57     public void testEqual2() {
58         assertTrue(StringHelper.equal("a", "a"));
59     }
60
61     public void testEqual3() {
62         assertFalse(StringHelper.equal(null, ""));
63     }
64
65     public void testEqual4() {
66         assertFalse(StringHelper.equal("", null));
67     }
68
69     public void testEqual5() {
70         assertFalse(StringHelper.equal("a", "A"));
71     }
72
73     public void testEqual6() {
74         assertFalse(StringHelper.equal("a", "b"));
75     }
76
77     /*
78      * Test method for
79      * 'org.objectweb.petals.util.StringHelper.equalIgnoreCase(String, String)'
80      */

81     public void testequalIgnoreCaseIgnoreCase1() {
82         assertTrue(StringHelper.equalIgnoreCase(null, null));
83     }
84
85     public void testequalIgnoreCaseIgnoreCase2() {
86         assertTrue(StringHelper.equalIgnoreCase("a", "a"));
87     }
88
89     public void testequalIgnoreCaseIgnoreCase5() {
90         assertTrue(StringHelper.equalIgnoreCase("a", "A"));
91     }
92
93     public void testequalIgnoreCaseIgnoreCase3() {
94         assertFalse(StringHelper.equalIgnoreCase(null, ""));
95     }
96
97     public void testequalIgnoreCaseIgnoreCase4() {
98         assertFalse(StringHelper.equalIgnoreCase("", null));
99     }
100
101     public void testequalIgnoreCaseIgnoreCase6() {
102         assertFalse(StringHelper.equalIgnoreCase("a", "b"));
103     }
104
105 }
106
Popular Tags