File: AnyTestCase.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 (40 lines) | stat: -rw-r--r-- 1,141 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

package test.wsdl.any;

/**
 * @author Ashutosh Shahi
 *
 * Test to check if MessageElement [] for <any>
 * includes all elements 
 */
public class AnyTestCase extends junit.framework.TestCase{
	
    public AnyTestCase(java.lang.String name) {
        super(name);
    }
    
    public void testAny1() throws Exception{
    	AnyServiceLocator loc = new AnyServiceLocator(); 
    	Soap svc = loc.getSoap();
    	
    	QueryResult qr = svc.query("blah");
    	
    	assertTrue("Records size mismatch", qr.getRecords().length == 1);
		 for (int i =0; i < qr.getRecords().length; i++ ) { 
		 	SObject s = qr.getRecords(i);
		 	System.out.println("id::" + s.getId());
		 	org.apache.axis.message.MessageElement [] e= s.get_any();
		 	System.out.println("MessageElement array size is " + e.length);
		 	 for (int j = 0; j < e.length; j++ ){ 
		 	 	 System.out.print(" " + e[j].getValue()); 
		 	 }
		 	 System.out.println(""); 
		 	assertTrue("Any should have three elements", e.length == 3);
		 }
    }
    
    public static void main(String[] args) throws Exception{
    	AnyTestCase at = new AnyTestCase("test");
    	at.testAny1();
    }
}