In the zip file I attached to my original message, there's a JUnit test case at src/org/castor/example/CollectionNamespaceTest.java.
Is that not what you were looking for? -Dan On Mon, Jun 8, 2009 at 5:45 AM, Werner Guttmann <[email protected]>wrote: > Hi Dan, > > sure it is. It's just that you have not included the JUnit test code. > > Cheers > Werner > > Dan wrote: > > Sure thing, Werner. > > > > Is the JUnit 4 test case I included not sufficient? It has two test > > methods, one that passes (no namespace) and one that fails (namespace). > > When the bug is fixed, both tests should pass. > > > > Please let me know if the test case should be changed in any way before I > > post everything to Jira. > > > > Thanks, > > -Dan > > > > On Sun, Jun 7, 2009 at 12:53 PM, Werner Guttmann < > [email protected]>wrote: > > > >> Dan, > >> > >> can you please create a new Jira issue and attach all relevant files to > >> this. Or even better, can you please attach a fully working (JUnit) test > >> case that allows us to replay the problem as is ? > >> > >> Cheers > >> Werner > >> > >> Dan wrote: > >>> Hello. > >>> > >>> There appears to be a bug when you unmarshall an input file that has a > >>> namespace (xmlns) declared on the root element. > >>> > >>> Everything unmarshalls fine, except any wrapper elements containing > >>> collections. These are left as null on the Java object tree. > >>> > >>> I have attached a very simple example showing this, along with a JUnit > to > >>> test it. Here are the mapping and input files, for quick perusal: > >>> > >>> > >> > ======================================================================================== > >>> <?xml version="1.0" encoding="UTF-8" ?> > >>> <mapping > >>> xmlns="http://castor.exolab.org/" > >>> xsi:schemaLocation="http://castor.exolab.org/ /META-INF/oxm.xsd" > >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>> <class name="org.castor.example.Report"> > >>> <field name="accounts" type="org.castor.example.Account" > >>> collection="array" container="false" /> > >>> </class> > >>> </mapping> > >>> > >> > ======================================================================================== > >>> <?xml version="1.0" encoding="UTF-8" ?> > >>> <report xmlns="http://www.castor.org/example"> > >>> <accounts> > >>> <account guid="123" /> > >>> </accounts> > >>> </report> > >>> > >> > ======================================================================================== > >>> If you remove the "xmlns" attribute on the "report" element in the > input > >>> file, the unmarshalling works perfectly. > >>> > >>> Furthermore, setting "org.exolab.castor.parser.namespaces = true" > either > >> in > >>> castor.properties or programmatically via Unmarshaller.setProperty() > >> seems > >>> to have no effect. > >>> > >>> Please let me know if this is a bug, and I can post it to Jira. > >>> > >>> Thanks, > >>> -Dan > >>> > >>> > >>> > >>> > ------------------------------------------------------------------------ > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe from this list, please visit: > >>> > >>> http://xircles.codehaus.org/manage_email > >> --------------------------------------------------------------------- > >> To unsubscribe from this list, please visit: > >> > >> http://xircles.codehaus.org/manage_email > >> > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >

