Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313373 - JAXB Externalized Metadata JUnit: Instance document (employee.xml) invalid for XmlAnyAttribute tests
Summary: JAXB Externalized Metadata JUnit: Instance document (employee.xml) invalid fo...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David McCann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 308677
  Show dependency tree
 
Reported: 2010-05-18 10:55 EDT by David McCann CLA
Modified: 2022-06-09 10:04 EDT (History)
0 users

See Also:


Attachments
Proposed fix (7.63 KB, patch)
2010-05-18 11:16 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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