FileDocCategorySizeDatePackage
UnionServiceTestCase.javaAPI DocApache Axis 1.42434Sat Apr 22 18:57:28 BST 2006test.wsdl.union

UnionServiceTestCase

public class UnionServiceTestCase extends TestCase

Fields Summary
Constructors Summary
public UnionServiceTestCase(String name)

        super(name);
    
Methods Summary
public voidtestBasicUnion1()

        // 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 right beans
        // so, basically, if this compiles, we are good to go
        // but running it won't hurt anything

        FooOpenEnum enum = null;

        String testStrURI = "http://foobar/A";
        enum = new FooOpenEnum(testStrURI);
        assertEquals(testStrURI, enum.toString());
        
        URI testURI = new URI(testStrURI);
        enum = new FooOpenEnum(testURI);
        assertEquals(testStrURI, enum.toString());
        assertEquals(testURI, enum.getAnyURIValue());
        
        enum = new FooOpenEnum(FooEnum.value1);
        assertEquals(FooEnum.value1.toString(), enum.toString());
        assertEquals(FooEnum.value1, enum.getFooEnumValue());
        assertEquals(FooEnum._value1, enum.getAnyURIValue());
    
public voidtestBasicUnion2()

        // 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 right beans
        // so, basically, if this compiles, we are good to go
        // but running it won't hurt anything

        DateOrDateTimeType type = null;

        type = new DateOrDateTimeType(5);
        assertEquals("5", type.toString());

        type = new DateOrDateTimeType(false);
        assertEquals("false", type.toString());
        
        Date date = new Date();
        type = new DateOrDateTimeType(date);
        assertEquals(date.toString(), type.toString());

        Calendar cal = Calendar.getInstance();
        type = new DateOrDateTimeType(cal);

        CalendarSerializer cs = new CalendarSerializer();
        assertEquals(cs.getValueAsString(cal, null), type.toString());