File: AttrGroupServiceTestCase.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 (67 lines) | stat: -rw-r--r-- 2,335 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
/**
 * AttrGroupServiceTestCase.java
 */

package test.wsdl.attrGroup;

public class AttrGroupServiceTestCase extends junit.framework.TestCase {
    public AttrGroupServiceTestCase(java.lang.String name) {
        super(name);
    }
    public void test1AttrGroupService() throws Exception {
        // make sure WSDL2Java generated the right stuff
        
        // we don't really need to test sending a request
        //   and getting a response, since many other tests comprehend that
        // all we need to do is make sure WSDL2Java generated
        //   the attributes needed from the attributeGroup definitions
        // so, basically, if this compiles, we are good to go
        // but running it won't hurt anything

        test.wsdl.attrGroup.Record1 rec1 = new test.wsdl.attrGroup.Record1();

        // an element defined within Record1
        rec1.setElem1(1);
        assertTrue("elem1 should be 1, but is "+rec1.getElem1(), rec1.getElem1()==1);

        // an attribute defined in an attributeGroup
        rec1.setAttr1(2);
        assertTrue("attr1 should be 2, but is "+rec1.getAttr1(), rec1.getAttr1()==2);

        // an attribute defined in Record1 itself
        rec1.setAttr3("x");
        assertTrue("attr3 should be x, but is "+rec1.getAttr3(), rec1.getAttr3().equals("x"));
        
        // two attributes from a known 1.1 soap encoding schema
        rec1.setId(new org.apache.axis.types.Id("theId"));
        rec1.setHref(new org.apache.axis.types.URI("a", "b"));

        test.wsdl.attrGroup.Record2 rec2 = new test.wsdl.attrGroup.Record2();
        
        // an element defined within Record2
        rec2.setElem2("2");

        // an attribute defined in a referenced attributeGroup within an attributeGroup
        rec2.setAttr1(2);
        
        // an attribute defined in an attributeGroup that has another nested reference
        rec2.setAttr2(1.2);
        
        // an attribute from a known 1.2 soap encoding schema
        rec2.setId(new org.apache.axis.types.Id("theId"));
    }

    /*
    public static void main(String[] args)
    {
        AttrGroupServiceTestCase test = new AttrGroupServiceTestCase("x");
        try {
            test.test1AttrGroupService();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    */
}