File: TestArray.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 (41 lines) | stat: -rw-r--r-- 1,386 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
package test.encoding;

import junit.framework.TestCase;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.message.RPCElement;
import org.apache.axis.message.RPCParam;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.commons.logging.Log;


/**
 *  Test the serialization of an array. Test case for Bug 14666
 *  (NullPointerException taken in ArraySerializer when specifying array as input parameter.)
 */
public class TestArray extends TestCase {
    static Log log =
            LogFactory.getLog(TestArray.class.getName());

    public TestArray(String name) {
        super(name);
    }
    
    public void testArray1() {
        String tab_items [] = new String[4];
        tab_items[0] = "table item 1";
        tab_items[1] = "table item 2";
        tab_items[2] = "table item 3";
        tab_items[3] = "table item 4";

        RPCParam in_table = new RPCParam("http://local_service.com/", "Input_Array", tab_items);
        RPCElement input = new RPCElement("http://localhost:8000/tester", "echoString",
                                  new Object[]{in_table});
        SOAPEnvelope env = new SOAPEnvelope();
        env.addBodyElement(input);
        String text = env.toString();
        assertTrue(text != null);
        for(int i=0;i<tab_items.length;i++){
            assertTrue(text.indexOf(tab_items[i])!=-1);
        }
    }
}