File: TestText.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (69 lines) | stat: -rw-r--r-- 1,911 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package test.message;

import junit.framework.TestCase;

import org.apache.axis.message.Text;

/**
 * Test case for {@link Text}.
 *
 * @author Ian P. Springer
 */
public class TestText extends TestCase
{

    private static final String VANILLA = "vanilla";
    private static final String CHOCOLATE = "chocolate";
    private static final String NULL = null;

    private Text vanillaText;
    private Text chocolateText;
    private Text nullText;
    private Text vanillaText2;

    protected void setUp() throws Exception
    {
        vanillaText = new org.apache.axis.message.Text( VANILLA );
        vanillaText2 = new org.apache.axis.message.Text( VANILLA );
        chocolateText = new org.apache.axis.message.Text( CHOCOLATE );
        nullText = new org.apache.axis.message.Text( NULL );
    }

    /**
     * Test for {@link org.apache.axis.message.Text#toString()}.
     *
     * @throws Exception on error
     */
    public void testToString() throws Exception
    {
        assertEquals( VANILLA, vanillaText.toString() );
        assertEquals( NULL, nullText.toString() );
    }

    /**
     * Test for {@link org.apache.axis.message.Text#hashCode()}.
     *
     * @throws Exception on error
     */
    public void testHashCode() throws Exception
    {
        assertEquals( VANILLA.hashCode(), vanillaText.hashCode() );
        assertEquals( 0, nullText.hashCode() );
    }

    /**
     * Test for {@link org.apache.axis.message.Text#equals(Object)}.
     *
     * @throws Exception on error
     */
    public void testEquals() throws Exception
    {
        assertEquals( vanillaText, vanillaText2 );
        assertEquals( vanillaText2, vanillaText );
        assertTrue( !vanillaText.equals( chocolateText ) );
        assertTrue( !chocolateText.equals( vanillaText ) );
        assertTrue( !vanillaText.equals( null ) );
        assertTrue( !vanillaText.equals( VANILLA ) );
    }

}