Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313373

Summary: JAXB Externalized Metadata JUnit: Instance document (employee.xml) invalid for XmlAnyAttribute tests
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: David McCann <david.mccann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 308677    
Attachments:
Description Flags
Proposed fix none

Description David McCann CLA 2010-05-18 10:55:58 EDT
The employee instance document is not valid against the generated schema and needs to be fixed in order for validation to succeed.  The issue is that the XmlAnyAttribute (stuff) has the default namespace set, which is ##other, meaning that the any content must come from a namespace other than the target.  So the following line:

  <s:stuff first-name="Joe" last-name="Oracle" />

Should be changed to:

  <s:stuff xmlns:o="http://www.example.com/other" o:first-name="Joe" o:last-name="Oracle" />
Comment 1 David McCann CLA 2010-05-18 11:13:16 EDT
Upon further investigation, both read-only-employee.xml and write-only-employee.xml will require the same change as employee.xml.
Comment 2 David McCann CLA 2010-05-18 11:16:58 EDT
Created attachment 168947 [details]
Proposed fix

Consists of three modified instance docs, one modified test case (added instance doc validation code) and also added a convenience method to the ExternalizedMetadata test class for validation an instance doc against a given schema file.
Comment 3 David McCann CLA 2010-05-18 13:31:38 EDT
Reviewed by:  matt.macivor@oracle.com
Tests: unit tests pass as expected; AnyAttributeMappingTestCases
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:04:22 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink