cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Jones <peter.jo...@iona.com>
Subject aegis JaxbTypeTest
Date Mon, 29 Sep 2008 02:52:00 GMT

Hi there,

Think there's a small discrepancy in the rt/databinding/aegis JaxbTypeTest.
Note the type which is checked for when the element QName is
"elementProperty" in the two checks below:

    AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, JaxbBean1.class,
        "urn:foo", new TypeCreationOptions());
    ...
    QName element = (QName)elements.next();
    ...
    Type custom = info.getType(element);
    if ("bogusProperty".equals(element.getLocalPart())) {
        assertTrue(custom instanceof StringType);
    } else if ("elementProperty".equals(element.getLocalPart())) {
        assertTrue(custom instanceof CustomStringType);
    } else {
        fail("Unexpected element name: " + element.getLocalPart());
    }
    element = (QName)elements.next();
    ...
    custom = info.getType(element);
    if ("bogusProperty".equals(element.getLocalPart())) {
        assertTrue(custom instanceof StringType);
    } else if ("elementProperty".equals(element.getLocalPart())) {
        assertTrue(custom instanceof StringType);
    } else {
        fail("Unexpected element name: " + element.getLocalPart());
    }

If the "elementProperty" is the first QName, we check that the type is an
instance of CustomStringType, but if its the second Qname we check that
its an instance of StringType.

This is the annotation in the JaxbBean1 class:

    @XmlElement(type = CustomStringType.class)
        public String getElementProperty() {

Would that suggest the type should be a CustomStringType?  In the test, it's
always a StringType.

The test passes with the sun jdk as "elementProperty" is always the second
QName returned, but if you run this test with the ibm jdk, it fails since 
"elementProperty" is the first QName returned.

If the test is wrong and it should check for StringType both times, fair
enough, otherwise, I can file a jira.  Let me know if you have any thoughts.

Cheers,
Peter

-- 
Peter Jones
Progress Software
E-Mail: mailto:peter.jones@iona.com
Tel: 709-738-3725 x321 | Fax: 709-738-3745
570 Newfoundland Drive, St. John's, NL, Canada A1A 5B1

Mime
View raw message