File: TestCircularRefs.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 (46 lines) | stat: -rw-r--r-- 1,312 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
package test.encoding;

import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import test.GenericLocalTest;

import java.util.Vector;

public class TestCircularRefs extends GenericLocalTest {
    public TestCircularRefs() {
        super("foo");
    }

    public TestCircularRefs(String s) {
        super(s);
    }

	public void testCircularVectors() throws Exception {
        try {
            Call call = getCall();
            Object result = call.invoke("getCircle", null);
        } catch (AxisFault af){
            return;
        }
        fail("Expected a fault");
        // This just tests that we don't get exceptions during deserialization
        // for now.  We're still getting nulls for some reason, and once that's
        // fixed we should uncomment this next line
        
        // assertTrue("Result wasn't an array", result.getClass().isArray());
	}
    
    /**
     * Service method.  Return a Vector containing an object graph with a loop.
     * 
     * @return a Vector with circular references
     */ 
    public Vector getCircle() {
        Vector vector1 = new Vector();
        vector1.addElement("AString");
        Vector vector2 = new Vector();
        vector2.addElement(vector1);
        vector1.addElement(vector2);
        return vector2;
    }    
}