[jboss-svn-commits] JBoss Common SVN: r2269 - jbossxb-builder and 112 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Feb 8 07:41:50 EST 2007


Author: adrian at jboss.org
Date: 2007-02-08 07:41:49 -0500 (Thu, 08 Feb 2007)
New Revision: 2269

Added:
   jbossxb-builder/
   jbossxb-builder/.classpath
   jbossxb-builder/.project
   jbossxb-builder/pom.xml
   jbossxb-builder/src/
   jbossxb-builder/src/etc/
   jbossxb-builder/src/etc/default.mf
   jbossxb-builder/src/main/
   jbossxb-builder/src/main/java/
   jbossxb-builder/src/main/java/org/
   jbossxb-builder/src/main/java/org/jboss/
   jbossxb-builder/src/main/java/org/jboss/xb/
   jbossxb-builder/src/main/java/org/jboss/xb/annotations/
   jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlConstants.java
   jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/
   jbossxb-builder/src/main/java/org/jboss/xb/builder/BuilderSchemaBindingInitializer.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/AbstractPropertyHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArraySequenceBinding.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArrayWrapper.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BeanHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderSimpleParticleHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderUtil.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyWildcardHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/DOMHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyWildcardHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/SimplePropertyHandler.java
   jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ValueHandler.java
   jbossxb-builder/src/test/
   jbossxb-builder/src/test/java/
   jbossxb-builder/src/test/java/org/
   jbossxb-builder/src/test/java/org/jboss/
   jbossxb-builder/src/test/java/org/jboss/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/AbstractBuilderTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/BuilderTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/DebugElementHandler.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/JBossXBTestDelegate.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/TestSchemaResolver.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/AbstractErrorTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/ObjectTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/ObjectAttributeTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/IntegerAttribute.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/SimpleAttribute.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/StringAttribute.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/IntegerUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/StringUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/ObjectElementTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/ObjectXmlElementTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/SimpleElement.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/defaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/defaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/nondefaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/nondefaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/none/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/none/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/ObjectXmlRootElementTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/defaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/defaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/nondefaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/nondefaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/none/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/none/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/ObjectJBossXmlSchemaTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/Defaults.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/NonDefaults.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/None.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/ObjectSchemaTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/ObjectTypeTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/ObjectTypeAccessorTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/All.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Alpha.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Bean.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Sequence.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/ObjectTypeCollectionTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArray.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArrayList.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootHashSet.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/AbstractCollectionTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayListUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/HashSetUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/ObjectTypeSimpleTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/AbstractSimpleTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/IntegerUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/StringUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/ObjectTypeValueTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/IntegerValue.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SimpleValue.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SpecifiedValue.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/StringValue.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/AbstractValueTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/IntegerUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValueUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValueUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/StringUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/ObjectTypeXmlAnyElementTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/AnotherJavaBean.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayElementWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayObjectWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ElementWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListElementWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListObjectWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleJavaBean.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleObjectWildcard.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcardUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/ObjectTypeXmlEnumTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumConstantUnconvertable.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumGlobalType.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumNotSimple.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/defaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/defaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/nondefaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/nondefaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/none/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/none/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/ObjectTypeXmlTransientTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Bean.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Factory.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/FactoryBean.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritanceUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/ObjectTypeXmlTypeTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/defaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/defaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/nondefaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/nondefaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/none/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/none/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/ObjectXmlSchemaTestSuite.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/package-info.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/package-info.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/package-info.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nopkg/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nopkg/Root.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/AbstractDefaultsTest.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/DefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoPkgUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaultsUnitTestCase.java
   jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoneUnitTestCase.java
   jbossxb-builder/src/test/resources/
   jbossxb-builder/src/test/resources/org/
   jbossxb-builder/src/test/resources/org/jboss/
   jbossxb-builder/src/test/resources/org/jboss/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/Integer.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/String.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/None.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/None.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/None.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/All.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Alpha.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Sequence.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/Array.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/ArrayList.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/HashSet.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/Integer.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/String.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/Integer.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValue.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValue.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/String.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcard.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertable.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalType.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimple.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/None.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritance.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/None.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/Defaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NoPkg.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaults.xml
   jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/None.xml
   jbossxb-builder/src/test/resources/xml.xsd
Log:
Initial Import

Added: jbossxb-builder/.classpath
===================================================================
--- jbossxb-builder/.classpath	                        (rev 0)
+++ jbossxb-builder/.classpath	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry kind="src" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/jbossxb"/>
+	<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.8/log4j-1.2.8.jar"/>
+	<classpathentry kind="var" path="M2_REPO/jboss/jboss-test/1.0.1.GA/jboss-test-1.0.1.GA.jar"/>
+	<classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.2.GA/jboss-common-core-2.0.2.GA.jar"/>
+	<classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA.jar"/>
+	<classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.2.GA/jboss-logging-spi-2.0.2.GA.jar"/>
+	<classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1/jaxb-api-2.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/jboss/jboss-container/snapshot/jboss-container-snapshot.jar"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>


Property changes on: jbossxb-builder/.classpath
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/.project
===================================================================
--- jbossxb-builder/.project	                        (rev 0)
+++ jbossxb-builder/.project	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,14 @@
+<projectDescription>
+  <name>jbossxb-builder</name>
+  <comment>JBoss XML Binding Builder</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments/>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>


Property changes on: jbossxb-builder/.project
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/pom.xml
===================================================================
--- jbossxb-builder/pom.xml	                        (rev 0)
+++ jbossxb-builder/pom.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,210 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>jboss</groupId>
+  <artifactId>jbossxb-builder</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0.snapshot</version>
+  <name>JBoss XML Binding</name>
+  <url>http://www.jboss.org</url>
+  <description>JBoss XML Binding Builder</description>
+  <licenses>
+    <license>
+      <name>lgpl</name>
+      <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+    </license>
+  </licenses>
+  <organization>
+    <name>JBoss Inc.</name>
+    <url>http://www.jboss.org</url>
+  </organization>
+  
+  <repositories>
+    <repository>
+      <id>jboss</id>
+      <name>JBoss Inc. Repository</name>
+      <layout>default</layout>
+      <url>http://repository.jboss.com/maven2/</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  
+  <pluginRepositories>
+    <pluginRepository>
+      <id>jbosspluginrepo</id>
+      <name>jboss plugin repository</name>
+      <url>http://repository.jboss.com/maven2</url>
+      <layout>default</layout>
+      <snapshots>
+        <enabled>false</enabled>
+        <updatePolicy>never</updatePolicy>
+      </snapshots>
+    </pluginRepository>
+    <pluginRepository>
+      <id>central</id>
+      <name>LSU maven2 mirror</name>
+        <!-- <url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url> -->
+        <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
+      <layout>default</layout>
+      <snapshots>
+        <enabled>false</enabled>
+        <updatePolicy>never</updatePolicy>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
+  
+  
+  <build>
+    <sourceDirectory>src/main/java</sourceDirectory>
+    <finalName>jboss-xml-binding-builder</finalName>
+    <plugins>
+      
+      <!-- define how we want compilation to take place
+        here, we accept most of the defaults but say that we want the
+        optimization flag set, and define the source and target to be 1.4,
+        these setting will be inherited by child projects -->
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0</version>
+        <configuration>
+          <optimize>true</optimize>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>  
+      
+      <!-- define that we wish to create src jars -->
+      <plugin>
+        <artifactId>maven-source-plugin</artifactId>
+        <inherited>true</inherited>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>     
+      
+      <!-- describe the jarring process -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+        <!--
+          <configuration>
+          <jarName>jboss-xml-binding</jarName>
+          </configuration>
+        -->
+      </plugin>
+      
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <printSummary>true</printSummary>
+          <disableXmlReport>false</disableXmlReport>
+          <testFailureIgnore>true</testFailureIgnore>
+          <includes>
+            <include>**/**UnitTestCase.java</include>
+          </includes>
+          <!--forkMode>pertest</forkMode-->
+        </configuration>
+      </plugin>    
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>    
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-logging-spi</artifactId>
+      <version>2.0.2.GA</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-logging-log4j</artifactId>
+      <version>2.0.2.GA</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-common-core</artifactId>
+      <version>2.0.2.GA</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-xml-binding</artifactId>
+      <version>1.0.0.snapshot</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-test</artifactId>
+      <version>snapshot</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>oswego-concurrent</groupId>
+      <artifactId>concurrent</artifactId>
+      <version>1.3.4</version>
+      <scope>test</scope>
+    </dependency> 
+    <dependency>
+      <groupId>apache-xerces</groupId>
+      <artifactId>xercesImpl</artifactId>
+      <version>2.7.1</version>
+      <scope>test</scope>
+    </dependency>     
+    <dependency>
+      <groupId>wutka-dtdparser</groupId>
+      <artifactId>dtdparser121</artifactId>
+      <version>1.2.1</version>
+      <scope>test</scope>
+    </dependency>         
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>sun-jaf</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.0.2</version>
+      <scope>compile</scope>
+    </dependency> 
+    <dependency>
+      <groupId>sun-jaxb</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>2.1</version>
+      <scope>compile</scope>
+    </dependency> 
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-container</artifactId>
+      <version>snapshot</version>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>  
+  
+  <distributionManagement>
+    <repository>
+      <id>cvs-file-repository</id>
+      <!-- Set maven.cvs.root in your settings.xml -->
+      <url>file://${maven.cvs.root}</url>
+    </repository>
+  </distributionManagement>
+</project>


Property changes on: jbossxb-builder/pom.xml
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/etc/default.mf
===================================================================
--- jbossxb-builder/src/etc/default.mf	                        (rev 0)
+++ jbossxb-builder/src/etc/default.mf	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Created-By: @java.vm.version@ (@java.vm.vendor@)
+Specification-Title: @specification.title@
+Specification-Version: @specification.version@
+Specification-Vendor: @specification.vendor@
+Implementation-Title: @implementation.title@
+Implementation-URL: @implementation.url@
+Implementation-Version: @implementation.version@
+Implementation-Vendor: @implementation.vendor@
+Implementation-Vendor-Id: @implementation.vendor.id@


Property changes on: jbossxb-builder/src/etc/default.mf
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlConstants.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlConstants.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlConstants.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.annotations;
+
+/**
+ * JBossXmlConstants.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBossXmlConstants
+{
+   /** A default value */
+   String DEFAULT = "##default";
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * JBossXmlSchema.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Target({ElementType.TYPE, ElementType.PACKAGE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface JBossXmlSchema
+{
+   /** The namespace **/
+   String namespace() default JBossXmlConstants.DEFAULT;
+   
+   /** Whether to ignore unresolved field and class names, default true */
+   boolean ignoreUnresolvedFieldOrClass() default true;
+
+   /** Should _ be considered as part of a java identifier, default true */
+   boolean ignoreLowLine() default true;
+
+   /** Should system properties be replaced, default true */
+   boolean replacePropertyRefs() default true;
+
+   /** The package name to resolve classes, default is package or the package of the type */
+   String packageName() default JBossXmlConstants.DEFAULT;
+}


Property changes on: jbossxb-builder/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/BuilderSchemaBindingInitializer.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/BuilderSchemaBindingInitializer.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/BuilderSchemaBindingInitializer.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder;
+
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer;
+
+/**
+ * BuilderSchemaBindingInitializer.
+ * 
+ * @param <T> the root typefs
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuilderSchemaBindingInitializer<T> implements SchemaBindingInitializer
+{
+   /** The root class */
+   private Class<T> root;
+   
+   /**
+    * Create a new BuilderSchemaBindingInitializer.
+    * 
+    * @param root the root class
+    * @throws IllegalArgumentException for a null root
+    */
+   public BuilderSchemaBindingInitializer(Class<T> root)
+   {
+      if (root == null)
+         throw new IllegalArgumentException("Null root");
+      this.root = root;
+   }
+   
+   public SchemaBinding init(SchemaBinding schema)
+   {
+      JBossXBBuilder.build(schema, root);
+      return schema;
+   }
+
+}


Property changes on: jbossxb-builder/src/main/java/org/jboss/xb/builder/BuilderSchemaBindingInitializer.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,219 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder;
+
+import java.util.Collections;
+import java.util.HashSet;
+
+import javax.xml.XMLConstants;
+
+import org.jboss.config.plugins.property.PropertyConfiguration;
+import org.jboss.config.spi.Configuration;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.PackageInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.binding.metadata.PackageMetaData;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer;
+
+/**
+ * JBossXBBuilder.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossXBBuilder
+{
+   /** The configuration */
+   static Configuration configuration = new PropertyConfiguration();
+   
+   /** The string type */
+   static final ClassInfo STRING = configuration.getClassInfo(String.class);
+   
+   /**
+    * Create a new schema binding initializer
+    * 
+    * @param <T> the root type
+    * @param root the root class
+    * @return the initializer
+    * @throws IllegalArgumentException for a null root
+    */
+   public static <T> SchemaBindingInitializer newInitializer(Class<T> root)
+   {
+      return new BuilderSchemaBindingInitializer<T>(root);
+   }
+   
+   /**
+    * Build from a preparsed schema binding
+    * 
+    * @param schemaBinding the schema binding
+    * @param root the root
+    * @throws IllegalArgumentException for a null schema binding or root
+    */
+   public static void build(SchemaBinding schemaBinding, Class<?> root)
+   {
+      if (schemaBinding == null)
+         throw new IllegalArgumentException("Null schemaBinding");
+      if (root == null)
+         throw new IllegalArgumentException("Null root");
+
+      // TODO build
+   }
+   
+   /**
+    * Build the SchemaBinding from the class
+    * 
+    * @param root the root
+    * @return the schema binding
+    * @throws IllegalArgumentException for a null  root
+    */
+   public static SchemaBinding build(Class<?> root)
+   {
+      ClassInfo classInfo = JBossXBBuilder.configuration.getClassInfo(root);
+
+      SchemaBinding binding = classInfo.getAttachment(SchemaBinding.class);
+      if (binding == null)
+      {
+         JBossXBNoSchemaBuilder builder = new JBossXBNoSchemaBuilder(classInfo);
+         binding = builder.build();
+         classInfo.setAttachment(SchemaBinding.class.getName(), binding);
+      }
+      return binding;
+   }
+   
+   /**
+    * Initialize the schema binding from the root
+    * 
+    * @param schemaBinding the schema binding
+    * @param classInfo the classInfo
+    */
+   protected static void initSchema(SchemaBinding schemaBinding, ClassInfo classInfo)
+   {
+      // Look for a schema attribute on either the root or the root's package
+      JBossXmlSchema schema = classInfo.getUnderlyingAnnotation(JBossXmlSchema.class);
+      PackageInfo packageInfo = classInfo.getPackage();
+      if (schema == null && packageInfo != null)
+      {
+         schema = packageInfo.getUnderlyingAnnotation(JBossXmlSchema.class);
+      }
+      
+      // Use the root's package name
+      String packageName = null;
+      if (packageInfo != null)
+         packageName = packageInfo.getName();
+      // Look for annotation override
+      if (schema != null)
+      {
+         String schemaPackageName = schema.packageName();
+         if (JBossXmlConstants.DEFAULT.equals(schemaPackageName) == false)
+            packageName = schemaPackageName;
+      }
+
+      // Set the default namespace, if there are none already
+      if (schemaBinding.getNamespaces().isEmpty())
+      {
+         String namespace = XMLConstants.NULL_NS_URI;
+         if (schema != null)
+         {
+            String schemaNamespace = schema.namespace();
+            if (JBossXmlConstants.DEFAULT.equals(schemaNamespace) == false)
+               namespace = schemaNamespace;
+         }
+         schemaBinding.setNamespaces(new HashSet<String>(Collections.singleton(namespace)));
+      }
+      
+      // Apply the package name
+      if (packageName != null)
+      {
+         PackageMetaData packageMetaData = new PackageMetaData();
+         packageMetaData.setName(packageName);
+         schemaBinding.setPackageMetaData(packageMetaData);
+      }
+
+      // Nothing more to do if no annotation
+      if (schema == null)
+         return;
+      
+      // Apply the annotation values
+      schemaBinding.setIgnoreUnresolvedFieldOrClass(schema.ignoreUnresolvedFieldOrClass());
+      schemaBinding.setIgnoreLowLine(schema.ignoreLowLine());
+      schemaBinding.setReplacePropertyRefs(schema.replacePropertyRefs());
+   }
+
+   /**
+    * Generate an xml name from a clazz name
+    * 
+    * @param typeInfo the typeInfo
+    * @param ignoreLowerLine whether to ignore the lower line
+    * @return the xml name
+    */
+   public static String generateXMLNameFromClassName(TypeInfo typeInfo, boolean ignoreLowerLine)
+   {
+      return generateXMLNameFromJavaName(typeInfo.getSimpleName(), true, ignoreLowerLine);
+   }
+   
+   /**
+    * Generate an xml name from a java name
+    * 
+    * @param string the java name
+    * @param dash whether to insert dashes to seperate words
+    * @param ignoreLowerLine TODO ignore the lower line
+    * @return the xml name
+    */
+   public static String generateXMLNameFromJavaName(String string, boolean dash, boolean ignoreLowerLine)
+   {
+      // Whether we have seen a lower case character
+      boolean seenLower = false;
+
+      // Whether this is the first character
+      boolean first = true;
+      
+      StringBuilder result = new StringBuilder(string.length());
+      for (int i = 0; i < string.length(); ++i)
+      {
+         char c = string.charAt(i);
+         // Lowercase until we see an uppercase character (but always on the first character)
+         if (first || seenLower == false && Character.isUpperCase(c))
+         {
+            result.append(Character.toLowerCase(c));
+            first = false;
+         }
+         // Insert the dash and start the next word with lowercase
+         // but only if we have seen a lower case character
+         else if (seenLower && Character.isUpperCase(c) && dash)
+         {
+            result.append('-');
+            result.append(Character.toLowerCase(c));
+            seenLower = false;
+         }
+         // Just append the character
+         else
+         {
+            result.append(c);
+            seenLower = true;
+         }
+      }
+      return result.toString();
+   }
+}


Property changes on: jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,1117 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.XmlAccessOrder;
+import javax.xml.bind.annotation.XmlAccessorOrder;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.joinpoint.plugins.Config;
+import org.jboss.logging.Logger;
+import org.jboss.reflect.plugins.introspection.ParameterizedClassInfo;
+import org.jboss.reflect.spi.ArrayInfo;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.EnumInfo;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.PackageInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.runtime.AbstractPropertyHandler;
+import org.jboss.xb.builder.runtime.ArraySequenceBinding;
+import org.jboss.xb.builder.runtime.BeanHandler;
+import org.jboss.xb.builder.runtime.BuilderParticleHandler;
+import org.jboss.xb.builder.runtime.BuilderSimpleParticleHandler;
+import org.jboss.xb.builder.runtime.CollectionPropertyHandler;
+import org.jboss.xb.builder.runtime.CollectionPropertyWildcardHandler;
+import org.jboss.xb.builder.runtime.DOMHandler;
+import org.jboss.xb.builder.runtime.EnumValueAdapter;
+import org.jboss.xb.builder.runtime.PropertyHandler;
+import org.jboss.xb.builder.runtime.PropertyWildcardHandler;
+import org.jboss.xb.builder.runtime.ValueHandler;
+import org.w3c.dom.Element;
+
+/**
+ * JBossXBNoSchemaBuilder.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossXBNoSchemaBuilder
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(JBossXBBuilder.class);
+   
+   /** Whether trace is enabled */
+   private boolean trace = log.isTraceEnabled();
+   
+   /** The schema binding */
+   private SchemaBinding schemaBinding;
+   
+   /** The root type */
+   private ClassInfo root;
+   
+   /** The namespace */
+   private String defaultNamespace;
+
+   /** The attribute form */
+   private XmlNsForm attributeForm = XmlNsForm.UNSET;
+
+   /** The element form */
+   private XmlNsForm elementForm = XmlNsForm.UNSET;
+   
+   /** A cache of types */
+   private Map<TypeInfo, TypeBinding> typeCache = new HashMap<TypeInfo, TypeBinding>();
+
+   /** A root elements we have processed */
+   private Map<TypeInfo, ElementBinding> rootCache = new HashMap<TypeInfo, ElementBinding>();
+   
+   /** The current location */
+   private Stack<Location> locations = new Stack<Location>();
+   
+   /**
+    * Create a new JBossXBNoSchemaBuilder.
+    * 
+    * @param root the root class info
+    * @throws IllegalArgumentException for a null root class info
+    */
+   public JBossXBNoSchemaBuilder(ClassInfo root)
+   {
+      if (root == null)
+         throw new IllegalArgumentException("Null root");
+
+      this.root = root;
+   }
+   
+   /**
+    * Build the schema
+    * 
+    * @return the schema
+    */
+   public SchemaBinding build()
+   {
+      initSchema();
+      createRootElements();
+      return schemaBinding;
+   }
+
+   /**
+    * Initialise the schema
+    */
+   protected void initSchema()
+   {
+      // Initialize the schema
+      schemaBinding = new SchemaBinding();
+      JBossXBBuilder.initSchema(schemaBinding, root);
+      if (trace)
+         log.trace("Building schema for " + root.getName() + " schemaBinding=" + schemaBinding);
+      
+      // Remember the default namespace
+      defaultNamespace = (String) schemaBinding.getNamespaces().iterator().next();
+      
+      // Look for an annotation
+      PackageInfo packageInfo = root.getPackage();
+      if (packageInfo != null)
+      {
+         XmlSchema xmlSchema = packageInfo.getUnderlyingAnnotation(XmlSchema.class);
+         if (xmlSchema != null)
+         {
+            String namespace = xmlSchema.namespace();
+            if (JBossXmlConstants.DEFAULT.equals(xmlSchema) == false && XMLConstants.NULL_NS_URI.equals(defaultNamespace))
+            {
+               defaultNamespace = namespace;
+               addNamespace(defaultNamespace, true);
+            }
+            
+            attributeForm = xmlSchema.attributeFormDefault();
+            elementForm = xmlSchema.elementFormDefault();
+         }
+      }
+   }
+   
+   /**
+    * Create the root elements
+    */
+   protected void createRootElements()
+   {
+      // Create the root element
+      createRootElementBinding(root);
+   }
+
+   /**
+    * Create a root element binding
+    * 
+    * @param typeInfo the type info
+    */
+   protected void createRootElementBinding(TypeInfo typeInfo)
+   {
+      // Already done/doing this
+      if (rootCache.containsKey(typeInfo))
+         return;
+      // Put a skeleton marker in the cache so we know not to redo it
+      rootCache.put(typeInfo, null);
+      
+      // We force the element to be a root element
+      push(typeInfo);
+      try
+      {
+         createElementBinding(typeInfo, typeInfo.getSimpleName(), true);
+         pop();
+      }
+      catch (Exception e)
+      {
+         throw rethrowWithLocation(e);
+      }
+   }
+
+   /**
+    * Create an element binding
+    * 
+    * @param typeInfo the type info
+    * @param name the java element name
+    * @param root pass true to force a root element
+    * @return the element binding
+    */
+   private ElementBinding createElementBinding(TypeInfo typeInfo, String name, boolean root)
+   {
+      // Resolve the type
+      TypeBinding typeBinding = resolveTypeBinding(typeInfo);
+      
+      // Create the element
+      return createElementBinding(typeInfo, typeBinding, name, root);
+   }
+   
+   /**
+    * Create an element binding
+    * 
+    * @param typeInfo the type info
+    * @param typeBinding the type binding
+    * @param name the java element name
+    * @param root pass true to force a root element
+    * @return the element binding
+    */
+   private ElementBinding createElementBinding(TypeInfo typeInfo, TypeBinding typeBinding, String name, boolean root)
+   {
+      // Determine the parameters
+      String overrideNamespace = null;
+      String overrideName = null;
+      if (typeInfo instanceof ClassInfo)
+      {
+         ClassInfo classInfo = (ClassInfo) typeInfo;
+         XmlRootElement xmlRootElement = classInfo.getUnderlyingAnnotation(XmlRootElement.class);
+         if (xmlRootElement != null)
+         {
+            overrideNamespace = xmlRootElement.namespace();
+            overrideName = xmlRootElement.name();
+         }
+      }
+      
+      // Create the binding
+      XmlNsForm form = elementForm;
+      if (root)
+         form = XmlNsForm.QUALIFIED;
+      QName qName = generateXmlName(name, form, overrideNamespace, overrideName);
+      return createElementBinding(typeInfo, typeBinding, qName, root);
+   }
+   
+   /**
+    * Create an element binding
+    * 
+    * @param typeInfo the type info
+    * @param typeBinding the type binding
+    * @param qName the qualified name
+    * @param root pass true to force a root element
+    * @return the element binding
+    */
+   private ElementBinding createElementBinding(TypeInfo typeInfo, TypeBinding typeBinding, QName qName, boolean root)
+   {
+      if (trace)
+         log.trace("creating element " + qName + " with type " + typeInfo.getName());
+
+      if (typeInfo instanceof ClassInfo)
+      {
+         ClassInfo classInfo = (ClassInfo) typeInfo;
+         XmlRootElement xmlRootElement = classInfo.getUnderlyingAnnotation(XmlRootElement.class);
+         if (xmlRootElement != null)
+            root = true;
+      }
+
+      
+      ElementBinding elementBinding = new ElementBinding(schemaBinding, qName, typeBinding);
+      if (trace)
+         log.trace("created  element " + qName + " element=" + elementBinding + " rootElement=" + root);
+
+      // If we are a root element bind it
+      if (root)
+      {
+         schemaBinding.addElement(elementBinding);
+         rootCache.put(typeInfo, elementBinding);
+      }
+      
+      return elementBinding;
+   }
+
+   /**
+    * Process a type
+    * 
+    * @param typeInfo the type info
+    */
+   protected void process(TypeInfo typeInfo)
+   {
+      if (typeInfo.isPrimitive() == false && typeInfo.isEnum() && typeInfo.isAnnotation() && Object.class.getName().equals(typeInfo.getName()) == false)
+      {
+         ClassInfo classInfo = (ClassInfo) typeInfo;
+         
+         // Create the type
+         resolveTypeBinding(typeInfo);
+         
+         // Check wether we need to add it as a root element
+         if (rootCache.containsKey(typeInfo) == false)
+         {
+            XmlRootElement xmlRootElement = classInfo.getUnderlyingAnnotation(XmlRootElement.class);
+           if (xmlRootElement != null)
+               createRootElementBinding(typeInfo);
+         }
+      }
+   }
+   
+   /**
+    * Resolve a type binding
+    *
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   @SuppressWarnings("unchecked")
+   protected TypeBinding resolveTypeBinding(TypeInfo typeInfo)
+   {
+      if (trace)
+         log.trace("resolving type " + typeInfo.getName());
+
+      // Look for a cached value
+      TypeBinding result = typeCache.get(typeInfo);
+      
+      // No cached value
+      if (result == null)
+      {
+         // Generate it
+         result = generateTypeBinding(typeInfo);
+            
+         // Cache it
+         typeCache.put(typeInfo, result);
+      }
+      if (trace)
+         log.trace("resolved  type " + typeInfo.getName() + " binding=" + result);
+     
+      // Return the result 
+      return result;
+   }
+
+   /**
+    * Generate a type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   protected TypeBinding generateTypeBinding(TypeInfo typeInfo)
+   {
+      try
+      {
+         if (typeInfo.isEnum())
+            return generateEnum((EnumInfo) typeInfo);
+
+         if (typeInfo.isAnnotation())
+            return generateAnnotation((ClassInfo) typeInfo);
+         
+         if (typeInfo.isArray())
+            return generateArray((ArrayInfo) typeInfo);
+         
+         if (typeInfo.isCollection())
+            return generateCollection((ClassInfo) typeInfo);
+         
+         if (typeInfo.isMap())
+            return generateMap((ClassInfo) typeInfo);
+         
+         TypeBinding typeBinding = isSimpleType(typeInfo);
+         if (typeBinding != null)
+            return typeBinding;
+         
+         return generateBean((ClassInfo) typeInfo);
+      }
+      finally
+      {
+         // Not a primitive type
+         if (typeInfo.isPrimitive() == false)
+         {
+            ClassInfo classInfo = (ClassInfo) typeInfo;
+
+            // Process our type args
+            TypeInfo[] typeArgs = classInfo.getActualTypeArguments();
+            if (typeArgs != null)
+            {
+               for (int i = 0; i < typeArgs.length; ++i)
+                  process(typeArgs[i]);
+            }
+            
+            // Process the super class
+            ClassInfo superClass = classInfo.getGenericSuperclass();
+            if (superClass != null)
+               process(superClass);
+         }
+      }
+   }
+   
+   /**
+    * Generate an enum type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateEnum(EnumInfo typeInfo)
+   {
+      // Determine the parameters
+      String overrideNamespace = null;
+      String overrideName = null;
+      boolean root = false;
+      XmlType xmlType = typeInfo.getUnderlyingAnnotation(XmlType.class);
+      if (xmlType != null)
+      {
+         root = true;
+         overrideNamespace = xmlType.namespace();
+         overrideName = xmlType.name();
+      }
+
+      // Determine the enum type 
+      Class<?> xmlEnumValue = String.class;
+      XmlEnum xmlEnum = typeInfo.getUnderlyingAnnotation(XmlEnum.class);
+      if (xmlEnum != null)
+         xmlEnumValue = xmlEnum.value();
+      TypeInfo enumType = typeInfo.getTypeInfoFactory().getTypeInfo(xmlEnumValue);
+      
+      // Resolve the enum type as the parent (must be simple)
+      TypeBinding parent = getSimpleType(enumType);
+      
+      // Create the enum type
+      QName qName = null;
+      TypeBinding typeBinding = null;
+      if (root)
+      {
+         qName = generateXmlName(typeInfo, XmlNsForm.QUALIFIED, overrideNamespace, overrideName);
+         typeBinding = new TypeBinding(qName, parent);
+      }
+      else
+      {
+         typeBinding = new TypeBinding(null, parent);
+      }
+         
+      typeBinding.setValueAdapter(new EnumValueAdapter(qName, typeInfo, enumType));
+
+      if (trace)
+         log.trace("Created enum=" + typeInfo.getName() + " type=" + typeBinding + " rootType=" + root);
+      
+      // Bind it as a global type
+      if (root)
+         schemaBinding.addType(typeBinding);
+      else
+         typeBinding.setSchemaBinding(schemaBinding);
+      
+      return typeBinding;
+   }
+   
+   /**
+    * Generate an annotation type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateAnnotation(ClassInfo typeInfo)
+   {
+      // TODO generateAnnotation
+      throw new UnsupportedOperationException("generateAnnotation");
+   }
+   
+   /**
+    * Generate an array type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateArray(ArrayInfo typeInfo)
+   {
+      return resolveTypeBinding(typeInfo.getComponentType());
+   }
+   
+   /**
+    * Generate a collection type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateCollection(ClassInfo typeInfo)
+   {
+      if (typeInfo instanceof ParameterizedClassInfo)
+      {
+         ParameterizedClassInfo parameterizedClassInfo = (ParameterizedClassInfo) typeInfo;
+         TypeInfo[] actualTypes = parameterizedClassInfo.getActualTypeArguments();
+         TypeInfo elementType = actualTypes[0];
+         return resolveTypeBinding(elementType);
+      }
+      else
+         throw new RuntimeException("Unable to determine element type for " + typeInfo);
+   }
+   
+   /**
+    * Generate a map type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateMap(ClassInfo typeInfo)
+   {
+      // TODO generateMap
+      throw new UnsupportedOperationException("generateMap");
+   }
+   
+   /**
+    * Check whether this is a simple type
+    * 
+    * @param typeInfo the type info
+    * @return the type binding if it is simple
+    */
+   public TypeBinding isSimpleType(TypeInfo typeInfo)
+   {
+      QName qName = SimpleTypeBindings.typeQName(typeInfo.getType());
+      if (qName == null)
+         return null;
+      TypeBinding result = schemaBinding.getType(qName);
+      if (result == null)
+         throw new IllegalStateException("SimpleType is not bound in the schema: " + qName + " for " + typeInfo.getName());
+      result.setHandler(BuilderSimpleParticleHandler.SIMPLE_INSTANCE);
+      return result;
+   }
+   
+   /**
+    * Get the simple type
+    * 
+    * @param typeInfo the type info
+    * @return the type binding if it is simple
+    * @throws IllegalStateException if the type is not bound
+    */
+   public TypeBinding getSimpleType(TypeInfo typeInfo)
+   {
+      TypeBinding result = isSimpleType(typeInfo);
+      if (result == null)
+         throw new IllegalStateException(typeInfo.getName() + " does not map to a simple type.");
+      return result;
+   }
+   
+   /**
+    * Generate a bean type binding
+    * 
+    * @param typeInfo the type info
+    * @return the type binding
+    */
+   public TypeBinding generateBean(ClassInfo typeInfo)
+   {
+      return generateBean(typeInfo, false);
+   }
+   
+   /**
+    * Generate a bean type binding
+    * 
+    * @param typeInfo the type info
+    * @param root whether to force a root type
+    * @return the type binding
+    */
+   public TypeBinding generateBean(ClassInfo typeInfo, boolean root)
+   {
+      return generateType(typeInfo, root);
+   }
+   
+   /**
+    * Generate a bean type binding
+    * 
+    * @param typeInfo the type info
+    * @param root whether to force a root type
+    * @return the type binding
+    */
+   public TypeBinding generateType(ClassInfo typeInfo, boolean root)
+   {
+      // Determine the paremeters
+      String overrideNamespace = null;
+      String overrideName = null;
+      ClassInfo factoryClassInfo = typeInfo;
+      String factoryMethod = null;
+      String[] propertyOrder = {""};
+      XmlAccessOrder accessOrder = XmlAccessOrder.UNDEFINED;
+      XmlType xmlType = typeInfo.getUnderlyingAnnotation(XmlType.class);
+      if (xmlType != null)
+      {
+         root = true;
+         overrideNamespace = xmlType.namespace();
+         overrideName = xmlType.name();
+         if (overrideName.length() == 0)
+            root = false;
+         
+         Class<?> factoryClass = xmlType.factoryClass();
+         if (factoryClass != XmlType.DEFAULT.class)
+            factoryClassInfo = (ClassInfo) typeInfo.getTypeInfoFactory().getTypeInfo(factoryClass);
+         factoryMethod = xmlType.factoryMethod();
+         propertyOrder = xmlType.propOrder();
+      }
+      // Determine the property access order
+      XmlAccessorOrder accessorOrder = typeInfo.getUnderlyingAnnotation(XmlAccessorOrder.class);
+      if (accessorOrder == null)
+      {
+         PackageInfo pkg = typeInfo.getPackage();
+         if (pkg != null)
+            accessorOrder = pkg.getUnderlyingAnnotation(XmlAccessorOrder.class);
+      }
+      if (accessorOrder != null)
+         accessOrder = accessorOrder.value();
+      
+      // Create the binding
+      TypeBinding typeBinding = null;
+      if (root)
+      {
+         QName qName = generateXmlName(typeInfo, XmlNsForm.QUALIFIED, overrideNamespace, overrideName);
+         typeBinding = new TypeBinding(qName);
+      }
+      else
+      {
+         typeBinding = new TypeBinding();
+      }
+
+      // Push into the cache early to avoid recursion
+      typeCache.put(typeInfo, typeBinding);
+
+      // Determine any factory method
+      MethodInfo factory = null;
+      if (factoryMethod != null && factoryMethod.length() > 0)
+         factory = Config.findMethodInfo(factoryClassInfo, factoryMethod, null, true, true);
+      
+      // Create the handler
+      BeanInfo beanInfo = JBossXBBuilder.configuration.getBeanInfo(typeInfo);
+      BeanHandler handler = new BeanHandler(beanInfo, factory);
+      typeBinding.setHandler(handler);
+      if (trace)
+         log.trace("Created BeanHandler for type=" + beanInfo.getName() + " factory=" + factory);
+
+      // Look through the properties
+      PropertyInfo valueProperty = null;
+      PropertyInfo wildcardProperty = null;
+      boolean allBinding = propertyOrder.length == 0;
+      boolean determinePropertyOrder = allBinding || (propertyOrder.length == 1 && propertyOrder[0].length() == 0);
+      ArrayList<String> propertyNames = new ArrayList<String>();
+      Set<PropertyInfo> properties = beanInfo.getProperties();
+      if (properties != null && properties.isEmpty() == false)
+      {
+         for (PropertyInfo property : properties)
+         {
+            push(typeInfo, property.getName());
+            
+            // Is this the value property?
+            XmlValue xmlValue = property.getUnderlyingAnnotation(XmlValue.class);
+            if (xmlValue != null)
+            {
+               if (trace)
+                  log.trace("Seen @XmlValue for type=" + beanInfo.getName() + " property=" + property.getName());
+               if (valueProperty != null)
+                  throw new RuntimeException("@XmlValue seen on two properties: " + property.getName() + " and " + valueProperty.getName());
+               valueProperty = property;
+            }
+            
+            // Is this the wildcard property?
+            XmlAnyElement xmlAnyElement = property.getUnderlyingAnnotation(XmlAnyElement.class);
+            if (xmlAnyElement != null)
+            {
+               if (trace)
+                  log.trace("Seen @XmlAnyElement for type=" + beanInfo.getName() + " property=" + property.getName());
+               if (wildcardProperty != null)
+                  throw new RuntimeException("@XmlAnyElement seen on two properties: " + property.getName() + " and " + wildcardProperty.getName());
+               wildcardProperty = property;
+            }
+
+            // Is this an attribute
+            XmlAttribute xmlAttribute = property.getUnderlyingAnnotation(XmlAttribute.class);
+            if (xmlAttribute != null)
+            {
+               // Determine the name
+               QName qName = generateXmlName(property.getName(), attributeForm, xmlAttribute.namespace(), xmlAttribute.name());
+               // Resolve the type
+               TypeBinding attributeType = resolveTypeBinding(property.getType());
+               // Create the attribute handler
+               AttributeHandler attributeHandler = new PropertyHandler(property, property.getType());
+               // Create the attributre and bind it to the type
+               AttributeBinding attribute = new AttributeBinding(schemaBinding, qName, attributeType, attributeHandler);
+               attribute.setRequired(xmlAttribute.required());
+               typeBinding.addAttribute(attribute);
+               if (trace)
+                  log.trace("Bound attribute " + qName + " type=" + beanInfo.getName() + " property=" + property.getName() +" propertyType=" + property.getType());
+            }
+
+            // Are we determining the property order?
+            if (determinePropertyOrder)
+            {
+               // Value property
+               if (xmlValue != null)
+               {
+                  if (trace)
+                     log.trace("Ignore not element @XmlValue for type=" + beanInfo.getName() + " property=" + property.getName());
+                  pop();
+                  continue;
+               }
+               // Wildcard property
+               if (xmlAnyElement != null)
+               {
+                  if (trace)
+                     log.trace("Ignore not element @XmlAnyElement for type=" + beanInfo.getName() + " property=" + property.getName());
+                  pop();
+                  continue;
+               }
+               // Ignore xml attribute
+               if (xmlAttribute != null)
+               {
+                  if (trace)
+                     log.trace("Ignore not element @XmlAttribute for type=" + beanInfo.getName() + " property=" + property.getName());
+                  pop();
+                  continue;
+               }
+               // Ignore xml tranient
+               XmlTransient xmlTransient = property.getUnderlyingAnnotation(XmlTransient.class);
+               if (xmlTransient != null)
+               {
+                  if (trace)
+                     log.trace("Ignore not element @XmlTransient for type=" + beanInfo.getName() + " property=" + property.getName());
+                  continue;
+               }
+               // Ignore the class property
+               String name = property.getName();
+               if ("class".equals(name))
+                  continue;
+               
+               if (trace)
+                  log.trace("Element for type=" + beanInfo.getName() + " property=" + property.getName());
+               propertyNames.add(property.getName());
+            }
+         }
+         // Apply any access order
+         if (determinePropertyOrder)
+         {
+            if (accessOrder == XmlAccessOrder.ALPHABETICAL)
+               Collections.sort(propertyNames);
+            propertyOrder = propertyNames.toArray(new String[propertyNames.size()]);
+         }            
+      }
+
+      // No value property, see if we have a default one
+      if (valueProperty == null)
+      {
+         try
+         {
+            valueProperty = beanInfo.getProperty("value");
+         }
+         catch (Exception ignored)
+         {
+            // Nope.
+         }
+      }
+      
+      // Bind the value
+      if (valueProperty != null)
+      {
+         CharactersHandler charactersHandler = new ValueHandler(valueProperty);
+         typeBinding.setCharactersHandler(charactersHandler);
+      }
+      else if (trace)
+         log.trace("No value for type=" + beanInfo.getName());
+      
+      if (trace)
+         log.trace("PropertyOrder " + Arrays.asList(propertyOrder) + " for type=" + beanInfo.getName());
+      
+      // Determine the model (we don't need one if there are no properties)
+      // TODO simple types/content when no properties other than @XmlValue and @XmlAttribute
+      typeBinding.setSimple(false);
+      ModelGroupBinding model = null;
+      if (propertyOrder.length > 0 || wildcardProperty != null)
+      {
+         if (allBinding)
+         {
+            if (trace)
+               log.trace("AllBinding for type=" + beanInfo.getName());
+            model = new AllBinding(schemaBinding);
+         }
+         else
+         {
+            if (trace)
+               log.trace("SequenceBinding for type=" + beanInfo.getName());
+            model = new SequenceBinding(schemaBinding);
+         }
+         model.setHandler(BuilderParticleHandler.INSTANCE);
+         typeBinding.setParticle(new ParticleBinding(model));
+      }
+
+      // Bind the wildcard
+      if (wildcardProperty != null)
+      {
+         ModelGroupBinding localModel = model;
+         TypeInfo wildcardType = wildcardProperty.getType();
+         TypeInfo type = wildcardType;
+         
+         // Setup any new model and determine the wildcard type
+         if (wildcardType.isArray())
+         {
+            localModel = createArray(localModel);
+            type = ((ArrayInfo) wildcardType).getComponentType();
+         }
+         else if (wildcardType.isCollection())
+         {
+            localModel = createCollection(localModel);
+            if (type instanceof ParameterizedClassInfo)
+            {
+               ParameterizedClassInfo pinfo = (ParameterizedClassInfo) type;
+               type = pinfo.getActualTypeArguments()[0];
+            }
+            else
+            {
+               type = type.getTypeInfoFactory().getTypeInfo(Object.class);
+            }
+         }
+         
+         XmlAnyElement xmlAnyElement = wildcardProperty.getUnderlyingAnnotation(XmlAnyElement.class);
+         WildcardBinding wildcard = new WildcardBinding(schemaBinding);
+         if (xmlAnyElement.lax())
+            wildcard.setProcessContents((short) 3); // Lax
+         else
+            wildcard.setProcessContents((short) 1); // Strict
+
+         // Dom element?
+         if (Element.class.getName().equals(type.getName()))
+         {
+            wildcard.setUnresolvedElementHandler(DOMHandler.INSTANCE);
+            wildcard.setUnresolvedCharactersHandler(DOMHandler.INSTANCE);
+         }
+         
+         // Bind the particle to the model
+         ParticleBinding particleBinding = new ParticleBinding(wildcard);
+         localModel.addParticle(particleBinding);
+         ParticleHandler wildcardHandler = null;
+         if (wildcardType.isCollection())
+            wildcardHandler = new CollectionPropertyWildcardHandler(wildcardProperty, wildcardType); 
+         else
+            wildcardHandler = new PropertyWildcardHandler(wildcardProperty, wildcardType);
+         typeBinding.getWildcard().setWildcardHandler(wildcardHandler);
+         handler.setWildcardHandler((AbstractPropertyHandler) wildcardHandler);
+      }
+      
+      // Look through the properties
+      for (String name : propertyOrder)
+      {
+         // Setup the error stack
+         push(typeInfo, name);
+
+         // Get the property
+         PropertyInfo property = beanInfo.getProperty(name); 
+         TypeInfo propertyType = property.getType();
+         if (trace)
+            log.trace("Processing type=" + beanInfo.getName() + " property=" + property.getName());
+         
+         // This is illegal
+         XmlTransient xmlTransient = property.getUnderlyingAnnotation(XmlTransient.class);
+         if (xmlTransient != null)
+            throw new RuntimeException("Property " + name + " in property order " + Arrays.asList(propertyOrder) + " is marked @XmlTransient");
+         
+         // The current model
+         ModelGroupBinding localModel = model;
+
+         // Setup any new model
+         if (propertyType.isArray())
+            localModel = createArray(localModel);
+         else if (propertyType.isCollection())
+            localModel = createCollection(localModel);
+         
+         // So this is element(s)
+         XmlElement[] elements = null;
+         XmlElement xmlElement = property.getUnderlyingAnnotation(XmlElement.class);
+         if (xmlElement != null)
+         {
+            // A single element annotated
+            elements = new XmlElement[] { xmlElement };
+         }
+         else
+         {
+            // Mutlple elements annotated, setup a choice
+            XmlElements xmlElements = property.getUnderlyingAnnotation(XmlElements.class);
+            if (xmlElements != null)
+            {
+               elements = xmlElements.value();
+               ChoiceBinding choice = new ChoiceBinding(schemaBinding);
+               choice.setHandler(BuilderParticleHandler.INSTANCE);
+               localModel.addParticle(new ParticleBinding(choice));
+               localModel = model;
+               if (trace)
+                  log.trace("XmlElements seen adding choice for type=" + beanInfo.getName() + " property=" + property.getName());
+            }
+         }
+         
+         // A single element not annotated
+         if (elements == null || elements.length == 0)
+            elements = new XmlElement[1];
+         
+         for (int i = 0; i < elements.length; ++i)
+         {
+            if (trace)
+               log.trace("Processing " + xmlElement + " for type=" + beanInfo.getName() + " property=" + property.getName());
+            
+            // Determine the parameters
+            overrideNamespace = null;
+            overrideName = null;
+            boolean nillable = false;
+            boolean required = false;
+            
+            XmlElement element = elements[i];
+            if (element != null)
+            {
+               overrideNamespace = element.namespace();
+               overrideName = element.name();
+               nillable = element.nillable();
+               required = element.required();
+               Class<?> elementType = element.type();
+               if (elementType != XmlElement.DEFAULT.class)
+                  propertyType = propertyType.getTypeInfoFactory().getTypeInfo(elementType);
+            }
+            
+            // Determine the name
+            QName qName = generateXmlName(property.getName(), elementForm, overrideNamespace, overrideName);
+
+            // Create the element
+            TypeBinding elementTypeBinding = resolveTypeBinding(propertyType);
+            ElementBinding elementBinding = createElementBinding(propertyType, elementTypeBinding, qName, false);
+            elementBinding.setNillable(nillable);
+            
+            // Bind it to the model
+            ParticleBinding particle = new ParticleBinding(elementBinding);
+            if (required == false)
+               particle.setMinOccurs(0);
+            localModel.addParticle(particle);
+            
+            // Create the handler
+            AbstractPropertyHandler propertyHandler = null;
+            if (propertyType.isCollection())
+               propertyHandler = new CollectionPropertyHandler(property, propertyType);
+            else
+               propertyHandler = new PropertyHandler(property, propertyType);
+            handler.addProperty(qName, propertyHandler);
+         }
+         pop();
+      }
+      
+      if (trace)
+         log.trace("Created type=" + typeInfo.getName() + " typeBinding=" + typeBinding + " rootType=" + root);
+
+      // Register as root if required
+      if (root)
+         schemaBinding.addType(typeBinding);
+      else
+         typeBinding.setSchemaBinding(schemaBinding);
+      
+      return typeBinding;
+   }
+
+   /**
+    * Create an array
+    * 
+    * @param localModel the current model
+    * @return the new local model
+    */
+   private ModelGroupBinding createArray(ModelGroupBinding localModel)
+   {
+      SequenceBinding sequenceBinding = new SequenceBinding(schemaBinding);
+      sequenceBinding.setHandler(BuilderParticleHandler.INSTANCE);
+      ArraySequenceBinding arraySequenceBinding = new ArraySequenceBinding(schemaBinding);
+      arraySequenceBinding.setHandler(BuilderParticleHandler.INSTANCE);
+      ParticleBinding particle = new ParticleBinding(sequenceBinding);
+      particle.setMaxOccursUnbounded(true);
+      arraySequenceBinding.addParticle(particle);
+      particle = new ParticleBinding(arraySequenceBinding);
+      localModel.addParticle(particle);
+      return sequenceBinding;
+   }
+
+   /**
+    * Create a collection
+    * 
+    * @param localModel the current model
+    * @return the new local model
+    */
+   private ModelGroupBinding createCollection(ModelGroupBinding localModel)
+   {
+      SequenceBinding sequenceBinding = new SequenceBinding(schemaBinding);
+      sequenceBinding.setHandler(BuilderParticleHandler.INSTANCE);
+      ParticleBinding particle = new ParticleBinding(sequenceBinding);
+      particle.setMaxOccursUnbounded(true);
+      localModel.addParticle(particle);
+      return sequenceBinding;
+   }
+
+   /**
+    * Add a namespace to the schema
+    * 
+    * @param namespace the namespace
+    * @param erase whether to erase if there was only the default namespace
+    */
+   @SuppressWarnings("unchecked")
+   private void addNamespace(String namespace, boolean erase)
+   {
+      Set<String> namespaces = schemaBinding.getNamespaces();
+      if (erase && namespaces.size() <= 1)
+         namespaces = new HashSet<String>(Collections.singleton(namespace));
+      namespaces.add(namespace);
+      schemaBinding.setNamespaces(namespaces);
+   }
+
+   /**
+    * Create a new xml name
+    * 
+    * @param typeInfo the type info
+    * @param form the namespace form
+    * @param namespace the override namespace
+    * @param name the override name
+    * @return the xml name
+    */
+   protected QName generateXmlName(TypeInfo typeInfo, XmlNsForm form, String namespace, String name)
+   {
+      return generateXmlName(typeInfo.getSimpleName(), form, namespace, name);
+   }
+
+   /**
+    * Create a new xml name
+    * 
+    * @param localName the raw local name
+    * @param form the namespace form
+    * @param namespace the override namespace
+    * @param name the override name
+    * @return the xml name
+    */
+   protected QName generateXmlName(String localName, XmlNsForm form, String namespace, String name)
+   {
+      String nsUri = XMLConstants.NULL_NS_URI;
+      if (form == XmlNsForm.QUALIFIED)
+         nsUri = defaultNamespace;
+      if (namespace != null && JBossXmlConstants.DEFAULT.equals(namespace) == false)
+         nsUri = namespace;
+      if (name != null && JBossXmlConstants.DEFAULT.equals(name) == false)
+         localName = name;
+      else
+         localName = JBossXBBuilder.generateXMLNameFromJavaName(localName, true, schemaBinding.isIgnoreLowLine());
+      return new QName(nsUri, localName);
+   }
+
+   private void push(TypeInfo typeInfo)
+   {
+      push(typeInfo, null);
+   }
+
+   private void push(TypeInfo typeInfo, String joinpoint)
+   {
+      locations.push(new Location(typeInfo, joinpoint));
+   }
+
+   private void pop()
+   {
+      locations.pop();
+   }
+
+   private RuntimeException rethrowWithLocation(Throwable t)
+   {
+      StringBuilder message = new StringBuilder();
+      message.append(t.getMessage());
+      message.append("\n");
+      while (locations.isEmpty() == false)
+      {
+         Location location = locations.pop();
+         location.append(message);
+         if (locations.isEmpty() == false);
+         message.append('\n');
+      }
+      throw new RuntimeException(message.toString(), t);
+   }
+   
+   /** A location */
+   private class Location
+   {
+      /** The type info */
+      TypeInfo typeInfo;
+      
+      /** The join point */
+      String joinpoint;
+      
+      Location(TypeInfo typeInfo, String joinpoint)
+      {
+         this.typeInfo = typeInfo;
+         this.joinpoint = joinpoint;
+      }
+      
+      public void append(StringBuilder builder)
+      {
+         builder.append("at ");
+         builder.append(typeInfo.getName());
+         if (joinpoint != null)
+            builder.append('.').append(joinpoint);
+      }
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/AbstractPropertyHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/AbstractPropertyHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/AbstractPropertyHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,124 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.logging.Logger;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeHandler;
+
+/**
+ * AbstractPropertyHandler
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractPropertyHandler extends AttributeHandler
+{
+   /** The log */
+   protected final Logger log = Logger.getLogger(getClass());
+   
+   /** Whether trace is enabled */
+   protected boolean trace = log.isTraceEnabled();
+   
+   /** The property info */
+   private PropertyInfo propertyInfo;
+   
+   /** The property type */
+   private TypeInfo propertyType;
+   
+   /**
+    * Create a new AbstractPropertyHandler
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null parameteers
+    */
+   public AbstractPropertyHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      if (propertyInfo == null)
+         throw new IllegalArgumentException("Null propertyInfo");
+      if (propertyType == null)
+         throw new IllegalArgumentException("Null propertyType");
+      this.propertyInfo = propertyInfo;
+      this.propertyType = propertyType;
+   }
+
+   /**
+    * Get the property info
+    * 
+    * @return the property info
+    */
+   public PropertyInfo getPropertyInfo()
+   {
+      return propertyInfo;
+   }
+
+   /**
+    * Get the property type
+    * 
+    * @return the property type
+    */
+   public TypeInfo getPropertyType()
+   {
+      return propertyType;
+   }
+   
+   public void doHandle(Object parent, Object child, QName qName)
+   {
+      if (trace)
+         log.trace("QName " + qName + " handle " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent) + " property=" + propertyInfo.getName());
+      
+      try
+      {
+         handle(propertyInfo, propertyType, parent, child, qName);
+      }
+      catch (RuntimeException e)
+      {
+         throw e;
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + "error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent));
+      }
+   }
+
+   @Override
+   public void attribute(QName elemName, QName attrName, AttributeBinding binding, Object owner, Object value)
+   {
+      doHandle(owner, value, attrName);
+   }
+
+   /**
+    * Handle the property
+    * 
+    * @param propertyInfo the property
+    * @param parent the parent
+    * @param propertyType the property type
+    * @param child the child
+    * @param qName the qName
+    */
+   public abstract void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName);
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArraySequenceBinding.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArraySequenceBinding.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArraySequenceBinding.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+
+/**
+ * Just a tagging class 
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArraySequenceBinding extends SequenceBinding
+{
+   /**
+    * Create a new ArraySequenceBinding.
+    * 
+    * @param schema the schema
+    */
+   public ArraySequenceBinding(SchemaBinding schema)
+   {
+      super(schema);
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArrayWrapper.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArrayWrapper.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ArrayWrapper.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,168 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.reflect.spi.ArrayInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+
+/**
+ * ArrayWrapper.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayWrapper
+{
+   /** The parent */
+   private Object parent;
+   
+   /** The element name */
+   private QName elementName;
+   
+   /** The elements */
+   private ArrayList<Object> elements = new ArrayList<Object>();
+   
+   /** The parent particle */
+   private ParticleBinding parentParticle;
+   
+   /** The child particle */
+   private ParticleBinding childParticle;
+   
+   /**
+    * Create a new ArrayWrapper.
+    * 
+    * @param parent the parent
+    * @param elementName the elementName
+    */
+   public ArrayWrapper(Object parent, QName elementName)
+   {
+      this.parent = parent;
+      this.elementName = elementName;
+   }
+
+   /**
+    * The elements 
+    * 
+    * @return the elements
+    */
+   public ArrayList<Object> getElements()
+   {
+      return elements;
+   }
+
+   /**
+    * Get the parent
+    * 
+    * @return the parent
+    */
+   public Object getParent()
+   {
+      return parent;
+   }
+   
+   /**
+    * Get the elementName.
+    * 
+    * @return the elementName.
+    */
+   public QName getElementName()
+   {
+      return elementName;
+   }
+
+   /**
+    * Add to the array
+    * 
+    * @param obj the object
+    */
+   public void add(Object obj)
+   {
+      elements.add(obj);
+   }
+
+   /**
+    * Get the childParticle.
+    * 
+    * @return the childParticle.
+    */
+   public ParticleBinding getChildParticle()
+   {
+      return childParticle;
+   }
+
+   /**
+    * Set the childParticle.
+    * 
+    * @param childParticle the childParticle.
+    */
+   public void setChildParticle(ParticleBinding childParticle)
+   {
+      this.childParticle = childParticle;
+   }
+
+   /**
+    * Get the parentParticle.
+    * 
+    * @return the parentParticle.
+    */
+   public ParticleBinding getParentParticle()
+   {
+      return parentParticle;
+   }
+
+   /**
+    * Set the parentParticle.
+    * 
+    * @param parentParticle the parentParticle.
+    */
+   public void setParentParticle(ParticleBinding parentParticle)
+   {
+      this.parentParticle = parentParticle;
+   }
+   
+   /**
+    * Get the elements 
+    *
+    * @param propertyType the property type
+    * @return the array
+    */
+   public Object[] getArray(TypeInfo propertyType)
+   {
+      ArrayInfo arrayInfo = (ArrayInfo) propertyType;
+      try
+      {
+         Object[] result = arrayInfo.newArrayInstance(elements.size());
+         for (int i = 0; i < result.length; ++i)
+            result[i] = elements.get(i);
+         return result;
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("Error creating array of type " + arrayInfo.getName() + " from " + elements, t);
+      }
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BeanHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BeanHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BeanHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,173 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.logging.Logger;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+
+/**
+ * BeanHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanHandler extends DefaultElementHandler
+{
+   /** The log */
+   private final Logger log = Logger.getLogger(getClass());
+   
+   /** Whether trace is enabled */
+   private boolean trace = log.isTraceEnabled();
+
+   /** The bean info */
+   private BeanInfo beanInfo;
+
+   /** Any factory  */
+   private MethodInfo factory;
+
+   /** The properties */
+   private Map<QName, AbstractPropertyHandler> properties;
+   
+   /** The wildcard handler */
+   private AbstractPropertyHandler wildcardHandler;
+   
+   /**
+    * Create a new bean info element handler
+    * 
+    * @param beanInfo the bean info
+    * @param factory the factory
+    */
+   public BeanHandler(BeanInfo beanInfo, MethodInfo factory)
+   {
+      if (beanInfo == null)
+         throw new IllegalArgumentException("Null beanInfo");
+      this.beanInfo = beanInfo;
+      this.factory = factory;
+   }
+
+   /**
+    * Get the bean info
+    * 
+    * @return the bean info
+    */
+   public BeanInfo getBeanInfo()
+   {
+      return beanInfo;
+   }
+   
+   /**
+    * Get the properties
+    * 
+    * @return the properties
+    */
+   public Map<QName, AbstractPropertyHandler> getProperties()
+   {
+      return properties;
+   }
+   
+   /**
+    * Add a property
+    * 
+    * @param qName the qName
+    * @param propertyHandler the property handler
+    */
+   public void addProperty(QName qName, AbstractPropertyHandler propertyHandler)
+   {
+      if (qName == null)
+         throw new IllegalArgumentException("Null qName");
+      if (propertyHandler == null)
+         throw new IllegalArgumentException("Null property handler");
+
+      if (properties == null)
+         properties = new HashMap<QName, AbstractPropertyHandler>();
+      properties.put(qName, propertyHandler);
+   }
+   
+   /**
+    * Get the wildcardHandler.
+    * 
+    * @return the wildcardHandler.
+    */
+   public AbstractPropertyHandler getWildcardHandler()
+   {
+      return wildcardHandler;
+   }
+
+   /**
+    * Set the wildcardHandler.
+    * 
+    * @param wildcardHandler the wildcardHandler.
+    */
+   public void setWildcardHandler(AbstractPropertyHandler wildcardHandler)
+   {
+      this.wildcardHandler = wildcardHandler;
+   }
+
+   @Override
+   public Object startElement(Object parent, QName qName, ElementBinding element)
+   {
+      try
+      {
+         if (factory != null)
+            return factory.invoke(null, null);
+         return beanInfo.newInstance();
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + " error instantiating " + beanInfo.getName(), t);
+      }
+   }
+
+   @Override
+   public void setParent(Object parent, Object o, QName qName, ElementBinding element, ElementBinding parentElement)
+   {
+      AbstractPropertyHandler propertyHandler = null;
+      if (properties != null)
+         propertyHandler = properties.get(qName);
+      if (propertyHandler == null)
+      {
+         if (wildcardHandler != null)
+         {
+            if (o != null && o instanceof ArrayWrapper)
+            {
+               ArrayWrapper wrapper = (ArrayWrapper) o;
+               wildcardHandler.doHandle(parent, wrapper, wrapper.getElementName());
+               return;
+            }
+         }
+         if (element.getSchema().isStrictSchema())
+            throw new RuntimeException("QName " + qName + " unknown property parent=" + BuilderUtil.toDebugString(parent) + " child=" + BuilderUtil.toDebugString(o));
+         if (trace)
+            log.trace("QName " + qName + " unknown property parent=" + BuilderUtil.toDebugString(parent) + " child=" + BuilderUtil.toDebugString(o));
+         return;
+      }
+      propertyHandler.doHandle(parent, o, qName);
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.xml.sax.Attributes;
+
+/**
+ * BuilderParticleHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuilderParticleHandler implements ParticleHandler
+{
+   /** The singleton instance */
+   public static final BuilderParticleHandler INSTANCE = new BuilderParticleHandler();
+   
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      TermBinding term = particle.getTerm();
+      if (term instanceof ArraySequenceBinding)
+         return new ArrayWrapper(parent, elementName);
+      return parent;
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      TermBinding term = particle.getTerm();
+      TermBinding parentTerm = parentParticle.getTerm();
+      if (term.isModelGroup() == false && parentTerm instanceof ElementBinding)
+      {
+         ElementBinding elementBinding = (ElementBinding) parentTerm;
+         if (parent != null && parent instanceof ArrayWrapper)
+         {
+            ArrayWrapper wrapper = (ArrayWrapper) parent;
+            wrapper.add(o);
+            wrapper.setChildParticle(particle);
+            wrapper.setParentParticle(parentParticle);
+            return;
+         }
+      
+         ParticleHandler particleHandler = elementBinding.getType().getHandler();
+         particleHandler.setParent(parent, o, elementName, particle, parentParticle);
+      }
+   }
+
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      TermBinding term = particle.getTerm();
+      if (term instanceof ArraySequenceBinding)
+      {
+         ArrayWrapper wrapper = (ArrayWrapper) o;
+         Object parent = wrapper.getParent();
+         ParticleBinding childParticle = wrapper.getChildParticle();
+         ParticleBinding parentParticle = wrapper.getParentParticle();
+         ElementBinding elementBinding = (ElementBinding) parentParticle.getTerm();
+         ParticleHandler particleHandler = elementBinding.getType().getHandler();
+         particleHandler.setParent(parent, wrapper, wrapper.getElementName(), childParticle, parentParticle);
+         return parent;
+      }
+      return o;
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderSimpleParticleHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderSimpleParticleHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderSimpleParticleHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.xml.sax.Attributes;
+
+/**
+ * BuilderSimpleParticleHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuilderSimpleParticleHandler extends BuilderParticleHandler
+{
+   /** The singleton instance */
+   public static final BuilderSimpleParticleHandler SIMPLE_INSTANCE = new BuilderSimpleParticleHandler();
+
+   @Override
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      return null;
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderUtil.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderUtil.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/BuilderUtil.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import org.jboss.util.Strings;
+import org.w3c.dom.Element;
+
+/**
+ * BuilderUtil.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuilderUtil
+{
+   /**
+    * Work out a safe debug string for the object
+    * 
+    * @param object the object
+    * @return the string
+    */
+   public static String toDebugString(Object object)
+   {
+      if (object == null)
+         return "null";
+
+      if (object instanceof String ||
+          object instanceof Boolean ||
+          object instanceof Byte ||
+          object instanceof Character ||
+          object instanceof Double ||
+          object instanceof Integer ||
+          object instanceof Float ||
+          object instanceof Short)
+         return object.toString();
+      
+      if (object instanceof Element)
+      {
+         Element element = (Element) object;
+         return "Element@" + System.identityHashCode(element) + "{" + element.getLocalName() + "}";
+      }
+      
+      return Strings.defaultToString(object);
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,120 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.ConstructorInfo;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * CollectionPropertyHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CollectionPropertyHandler extends AbstractPropertyHandler
+{
+   /** Whether this is a set */
+   private boolean isSet = false;
+   
+   /**
+    * Create a new CollectionPropertyHandler.
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null qName or property
+    */
+   public CollectionPropertyHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      super(propertyInfo, propertyType);
+      
+      TypeInfo set = propertyType.getTypeInfoFactory().getTypeInfo(Set.class);
+      if (set.isAssignableFrom(propertyType))
+         isSet = true;
+   }
+
+   @Override
+   @SuppressWarnings("unchecked")
+   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
+   {
+      Collection<Object> c = null;
+      try
+      {
+         if (propertyInfo.getGetter() != null)
+            c = (Collection) propertyInfo.get(parent);
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + " error getting collection property " + propertyInfo.getName() + " for " + BuilderUtil.toDebugString(parent), t);
+      }
+      
+      // No collection so create one
+      if (c == null)
+      {
+         ClassInfo collectionType = (ClassInfo) propertyType; 
+         if (Modifier.isAbstract(collectionType.getModifiers()) == false)
+         {
+            try
+            {
+               ConstructorInfo constructor = collectionType.getDeclaredConstructor(null);
+               c = (Collection) constructor.newInstance(null);
+            }
+            catch (Throwable t)
+            {
+               throw new RuntimeException("QName " + qName + " error creating collection: " + propertyType.getName(), t);
+            }
+         }
+         else if (isSet)
+            c = new HashSet<Object>();
+         else
+            c = new ArrayList<Object>();
+
+         try
+         {
+            propertyInfo.set(parent, c);
+         }
+         catch (Throwable t)
+         {
+            throw new RuntimeException("QName " + qName + " error setting collection property " + propertyInfo.getName() + " for " + BuilderUtil.toDebugString(parent) + " with value " + BuilderUtil.toDebugString(c), t);
+         }
+      }
+      
+      // Now add
+      try
+      {
+         c.add(child);
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("QName " + qName + " error adding " + BuilderUtil.toDebugString(child) + " to collection " + BuilderUtil.toDebugString(c), e);
+      }
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyWildcardHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyWildcardHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyWildcardHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.xml.sax.Attributes;
+
+/**
+ * CollectionPropertyWildcardHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CollectionPropertyWildcardHandler extends CollectionPropertyHandler implements ParticleHandler
+{
+   /**
+    * Create a new CollectionPropertyWildcardHandler.
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null property
+    */
+   public CollectionPropertyWildcardHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      super(propertyInfo, propertyType);
+   }
+
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      return parent;
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      doHandle(parent, o, elementName);
+   }
+
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      return o;
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/DOMHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/DOMHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/DOMHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,160 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.xb.binding.metadata.ValueMetaData;
+import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
+import org.xml.sax.Attributes;
+
+public class DOMHandler extends CharactersHandler implements ParticleHandler
+{
+   /** The logger */
+   private static final Logger log = Logger.getLogger(DOMHandler.class);
+
+   /** The instance */
+   public static final DOMHandler INSTANCE = new DOMHandler(); 
+   
+   /** Whether trace is enabled */
+   private boolean trace = log.isTraceEnabled();
+
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      if (trace)
+         log.trace("startParticle " + elementName + " parent=" + BuilderUtil.toDebugString(parent));
+      Element element = null;
+      if (parent == null || parent instanceof Element == false)
+         element = createTopElement(elementName.getNamespaceURI(), elementName.getLocalPart());
+      else
+         element = appendChildElement((Element) parent, elementName.getNamespaceURI(), elementName.getLocalPart());
+      addAttributes(element, attrs);
+      return element;
+   }
+
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      if (trace)
+         log.trace("endParticle " + elementName + " result=" + BuilderUtil.toDebugString(o));
+      return o;
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      if (trace)
+         log.trace("setParent " + elementName + " parent=" + BuilderUtil.toDebugString(parent) + " o=" + BuilderUtil.toDebugString(o));
+   }
+
+   @Override
+   public void setValue(QName qName, ElementBinding element, Object owner, Object value)
+   {
+      setText(owner, value, qName);
+   }
+
+   @Override
+   public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData, String value)
+   {
+      return value;
+   }
+
+   @Override
+   public Object unmarshalEmpty(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData)
+   {
+      return null;
+   }
+   
+   public Element createTopElement(String namespace, String name)
+   {
+      try
+      {
+         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+         factory.setNamespaceAware(true);
+         DocumentBuilder builder = factory.newDocumentBuilder();
+         DOMImplementation impl = builder.getDOMImplementation();
+         Document document = impl.createDocument(null, null, null);
+         
+         Element element = document.createElementNS(namespace, name);
+         document.appendChild(element);
+         if (trace)
+            log.trace("createTopElement " + namespace + ":" + name + " result=" + BuilderUtil.toDebugString(element));
+         return element;
+      }
+      catch (RuntimeException e)
+      {
+         throw e;
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Error creating dom", e);
+      }
+   }
+   
+   public Element appendChildElement(Element parentElement, String namespace, String name)
+   {
+      Document document = parentElement.getOwnerDocument();
+      Element element = document.createElementNS(namespace, name);
+      parentElement.appendChild(element);
+      if (trace)
+         log.trace("appendChild parent=" + BuilderUtil.toDebugString(parentElement) + " child=" + BuilderUtil.toDebugString(element));
+      return element;
+   }
+   
+   public void addAttributes(Element element, Attributes attrs)
+   {
+      for (int i = 0; i < attrs.getLength(); ++i)
+      {
+         String local = attrs.getLocalName(i);
+         String nsURI = attrs.getURI(i);
+         String value = attrs.getValue(i);
+         if (trace)
+            log.trace("setAttribute " + nsURI + " " + local + " element=" + BuilderUtil.toDebugString(element) + " value=" + value);
+         element.setAttributeNS(nsURI, local, value);
+      }
+   }
+   
+   public void setText(Object owner, Object value, QName qName)
+   {
+      if (value == null)
+         return;
+      if (owner == null || owner instanceof Element == false)
+         throw new IllegalStateException("Unexpected owner: " + owner + " for " + qName);
+      if (value instanceof String == false)
+         throw new IllegalStateException("Unexpected value " + value + " for " + qName);
+      Element element = (Element) owner;
+      Text text = element.getOwnerDocument().createTextNode((String) value);
+      if (trace)
+         log.trace("setText " + qName + " parent=" + BuilderUtil.toDebugString(owner) + " child=" + BuilderUtil.toDebugString(value));
+      element.appendChild(text);
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,115 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.namespace.QName;
+
+import org.jboss.reflect.spi.EnumConstantInfo;
+import org.jboss.reflect.spi.EnumInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
+
+/**
+ * EnumValueAdapter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EnumValueAdapter implements ValueAdapter
+{
+   /** The qName */
+   private QName qName;
+   
+   /** The valid values */
+   private Map<Object, Object> valid;
+   
+   /**
+    * Create a new EnumValueAdapter.
+    * 
+    * @param qName the qName
+    * @param enumInfo the enumeration
+    * @param enumType the enumType
+    * @throws IllegalArgumentException for a null enumInfo or enumType
+    */
+   public EnumValueAdapter(QName qName, EnumInfo enumInfo, TypeInfo enumType)
+   {
+      if (enumInfo == null)
+         throw new IllegalArgumentException("Null enumInfo");
+      if (enumType == null)
+         throw new IllegalArgumentException("Null enumType");
+      
+      this.qName = qName;
+      
+      // Setup the mapping
+      EnumConstantInfo[] constants = enumInfo.getEnumConstants();
+      valid = new HashMap<Object, Object>(constants.length);
+      for (EnumConstantInfo constant : constants)
+      {
+         String enumValue = constant.getName();
+         XmlEnumValue xmlEnumValue = constant.getUnderlyingAnnotation(XmlEnumValue.class);
+         if (xmlEnumValue != null)
+            enumValue = xmlEnumValue.value();
+         
+         Object key = enumValue;
+         try
+         {
+            key = enumType.convertValue(enumValue, false);
+         }
+         catch (Throwable t)
+         {
+            throw new RuntimeException("Error for enum " + enumInfo.getName() + " unable to convert " + enumValue + " to " + enumType.getName());
+         }
+         Object value = constant.getValue();
+         valid.put(key, value);
+      }
+   }
+   
+   /**
+    * Get the mapping
+    * 
+    * @return the mapping
+    */
+   public Map<Object, Object> getMapping()
+   {
+      return valid;
+   }
+   
+   @SuppressWarnings("unchecked")
+   public Object cast(Object o, Class c)
+   {
+      if (o == null)
+         return null;
+      
+      Object result = valid.get(o);
+      if (result == null)
+      {
+         if (qName == null)
+            throw new RuntimeException("Invalid value " + BuilderUtil.toDebugString(o) + " valid are " + valid.keySet());
+         throw new RuntimeException("Invalid value " + BuilderUtil.toDebugString(o) + " for " + qName + " valid are " + valid.keySet());
+      }
+      return result;
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * PropertyHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyHandler extends AbstractPropertyHandler
+{
+   /**
+    * Create a new PropertyHandler.
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null property
+    */
+   public PropertyHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      super(propertyInfo, propertyType);
+   }
+   
+   @Override
+   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
+   {
+      try
+      {
+         if (propertyType.isArray())
+         {
+            ArrayWrapper wrapper = (ArrayWrapper) child;
+            child = wrapper.getArray(propertyType);
+         }
+         propertyInfo.set(parent, child);
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent), t);
+      }
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyWildcardHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyWildcardHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/PropertyWildcardHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.xml.sax.Attributes;
+
+/**
+ * PropertyWildcardHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyWildcardHandler extends PropertyHandler implements ParticleHandler
+{
+   /**
+    * Create a new PropertyWildcardHandler.
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null property
+    */
+   public PropertyWildcardHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      super(propertyInfo, propertyType);
+   }
+
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      return parent;
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      if (parent != null && parent instanceof ArrayWrapper)
+      {
+         ArrayWrapper wrapper = (ArrayWrapper) parent;
+         wrapper.add(o);
+         wrapper.setChildParticle(particle);
+         wrapper.setParentParticle(parentParticle);
+         return;
+      }
+      doHandle(parent, o, elementName);
+   }
+
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      return o;
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/SimplePropertyHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/SimplePropertyHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/SimplePropertyHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * SimplePropertyHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimplePropertyHandler extends AbstractPropertyHandler
+{
+   /**
+    * Create a new PropertyHandler.
+    * 
+    * @param propertyInfo the property
+    * @param propertyType the property type
+    * @throws IllegalArgumentException for a null property
+    */
+   public SimplePropertyHandler(PropertyInfo propertyInfo, TypeInfo propertyType)
+   {
+      super(propertyInfo, propertyType);
+   }
+   
+   @Override
+   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
+   {
+      try
+      {
+         propertyInfo.set(parent, child);
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent));
+      }
+   }
+}

Added: jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ValueHandler.java
===================================================================
--- jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ValueHandler.java	                        (rev 0)
+++ jbossxb-builder/src/main/java/org/jboss/xb/builder/runtime/ValueHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,88 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.logging.Logger;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+
+/**
+ * ValueHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ValueHandler extends CharactersHandler
+{
+   /** The log */
+   private final Logger log = Logger.getLogger(getClass());
+   
+   /** Whether trace is enabled */
+   private boolean trace = log.isTraceEnabled();
+   
+   /** The property info */
+   private PropertyInfo propertyInfo;
+   
+   /**
+    * Create a new AbstractPropertyHandler
+    * 
+    * @param propertyInfo the property
+    * @throws IllegalArgumentException for a null qName or property
+    */
+   public ValueHandler(PropertyInfo propertyInfo)
+   {
+      if (propertyInfo == null)
+         throw new IllegalArgumentException("Null propertyInfo");
+      this.propertyInfo = propertyInfo;
+   }
+
+   /**
+    * Get the property info
+    * 
+    * @return the property info
+    */
+   public PropertyInfo getPropertyInfo()
+   {
+      return propertyInfo;
+   }
+
+   @Override
+   public void setValue(QName qName, ElementBinding element, Object owner, Object value)
+   {
+      if (trace)
+         log.trace("QName " + qName + " handle " + BuilderUtil.toDebugString(value) + " to " + BuilderUtil.toDebugString(owner));
+      try
+      {
+         TypeInfo typeInfo = propertyInfo.getType();
+         value = typeInfo.convertValue(value, false);
+         propertyInfo.set(owner, value);
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException("QName " + qName + " error setting characters " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(value) + " to " + BuilderUtil.toDebugString(owner) + " property=" + propertyInfo.getName(), t);
+      }
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/AbstractBuilderTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/AbstractBuilderTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/AbstractBuilderTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,249 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder;
+
+import java.net.URL;
+import java.util.Collection;
+
+import org.jboss.test.AbstractTestCaseWithSetup;
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.util.UnreachableStatementException;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultHandlers;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractBuilderTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractBuilderTest extends AbstractTestCaseWithSetup
+{
+   protected String rootName = getRootName();
+   
+   static
+   {
+      // Uncomment this to make sure we aren't using the RtElementHandler anywhere
+      DefaultHandlers.ELEMENT_HANDLER = new DebugElementHandler();
+      DefaultHandlers.SIMPLE_HANDLER = DefaultHandlers.ELEMENT_HANDLER;
+   }
+
+   public AbstractBuilderTest(String name)
+   {
+      super(name);
+   }
+
+   /**
+    * Setup the test delegate
+    * 
+    * @param clazz the class
+    * @return the delegate
+    * @throws Exception for any error
+    */
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+   {
+      return new JBossXBTestDelegate(clazz);
+   }
+
+   protected JBossXBTestDelegate getJBossXBDelegate()
+   {
+      return (JBossXBTestDelegate) getDelegate();
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      configureLogging();
+   }
+   
+   protected <T> T unmarshalObjectFromSchema(Class<T> expected) throws Exception
+   {
+      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+      // TODO this is a mess
+      String nsURI = "http://www.jboss.org/test/xml/" + rootName;
+      String packageName = getClass().getPackage().getName();
+      packageName = packageName.replace(".", "/");
+      String name = getClass().getName();
+      int dot = name.lastIndexOf('.');
+      if (dot != -1)
+         name = name.substring(dot + 1);
+      dot = name.lastIndexOf("UnitTestCase");
+      if (dot != -1)
+         name = name.substring(0, dot);
+      String testXsd = packageName + '/' + name + ".xsd";
+      resolver.addSchemaLocation(nsURI, testXsd);
+      resolver.addSchemaInitializer(nsURI, JBossXBBuilder.newInitializer(expected));
+      
+      String testXml = findTestXml();
+      Object o = unmarshal(testXml, expected, resolver);
+      assertNotNull(o);
+      getLog().debug("Unmarshalled " + o + " of type " + o.getClass().getName());
+      return expected.cast(o);
+   }
+   
+   protected <T> T unmarshalObject(Class<T> expected, Class... others) throws Exception
+   {
+      TestSchemaResolver resolver = new TestSchemaResolver();
+      
+      SchemaBinding schemaBinding = JBossXBBuilder.build(expected);
+      resolver.addSchemaBinding(schemaBinding);
+      if (others != null)
+      {
+         for (Class<?> other : others)
+         {
+            SchemaBinding otherBinding = JBossXBBuilder.build(other);
+            resolver.addSchemaBinding(otherBinding);
+         }
+      }
+      
+      String testXml = findTestXml();
+      Object o = unmarshal(testXml, schemaBinding);
+      assertNotNull(o);
+      getLog().debug("Unmarshalled " + o + " of type " + o.getClass().getName());
+      try
+      {
+         return expected.cast(o);
+      }
+      catch (ClassCastException e)
+      {
+         fail("Expected " + expected.getName() + " got " + o.getClass().getName());
+         throw new UnreachableStatementException();
+      }
+   }
+   
+   /**
+    * Unmarshal some xml
+    * 
+    * @param name the name
+    * @param schema the schema
+    * @return the unmarshalled object
+    * @throws Exception for any error
+    */
+   protected Object unmarshal(String name, SchemaBinding schema) throws Exception
+   {
+      String url = findXML(name);
+      return getJBossXBDelegate().unmarshal(url, schema);
+   }
+
+   protected <T> T unmarshalObject(Class<T> expected) throws Exception
+   {
+      return unmarshalObject(expected, null);
+   }
+   
+   /**
+    * Unmarshal some xml
+    * 
+    * @param name the name
+    * @param expected the expected type
+    * @param resolver the resolver
+    * @return the unmarshalled object
+    * @throws Exception for any error
+    */
+   protected Object unmarshal(String name, Class<?> expected, SchemaBindingResolver resolver) throws Exception
+   {
+      Object object = unmarshal(name, resolver);
+      if (object == null)
+         fail("No object from " + name);
+      assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass()));
+      return object;
+   }
+   
+   /**
+    * Unmarshal some xml
+    * 
+    * @param name the name
+    * @param resolver the resolver
+    * @return the unmarshalled object
+    * @throws Exception for any error
+    */
+   protected Object unmarshal(String name, SchemaBindingResolver resolver) throws Exception
+   {
+      String url = findXML(name);
+      return getJBossXBDelegate().unmarshal(url, resolver);
+   }
+
+   protected String findTestXml()
+   {
+      String result = rootName + "_" + getName() + ".xml";
+      if (getResource(result) == null)
+         result = rootName + ".xml";
+      return result;
+   }
+   
+   /**
+    * Get the package root name
+    * 
+    * @return the root name
+    */
+   protected String getRootName()
+   {
+      String longName = getClass().getName();
+      int dot = longName.lastIndexOf('.');
+      if (dot != -1)
+         longName = longName.substring(dot + 1);
+      dot = longName.lastIndexOf("UnitTestCase");
+      if (dot != -1)
+         longName = longName.substring(0, dot);
+      return longName;
+   }
+   
+   @SuppressWarnings("unchecked")
+   protected TermBinding assertSingleSequence(TermBinding term)
+   {
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      SequenceBinding sequence = (SequenceBinding) term;
+      Collection<ParticleBinding> particles = sequence.getParticles();
+      assertTrue(particles.size() == 1);
+      ParticleBinding particle = particles.iterator().next();
+      term = particle.getTerm();
+      assertNotNull(term);
+      return term;
+   }
+
+   /**
+    * Find the xml
+    * 
+    * @param name the name
+    * @return the url of the xml
+    */
+   protected String findXML(String name)
+   {
+      URL url = getResource(name);
+      if (url == null)
+         fail(name + " not found");
+      return url.toString();
+   }
+
+   @Override
+   public void configureLogging()
+   {
+      enableTrace("org.jboss.xb");
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/AbstractBuilderTest.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/BuilderTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/BuilderTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/BuilderTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.ObjectTestSuite;
+
+/**
+ * BuilderTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuilderTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Builder Tests");
+
+      suite.addTest(ObjectTestSuite.suite());
+
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/BuilderTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/DebugElementHandler.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/DebugElementHandler.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/DebugElementHandler.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.xml.sax.Attributes;
+
+/**
+ * DebugElementHandler.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DebugElementHandler implements ParticleHandler
+{
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+   {
+      throw new UnsupportedOperationException("Using Default Handler! startParticle: " + elementName + " " + particle);
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      throw new UnsupportedOperationException("Using Default Handler! setParent: " + elementName + " " + particle);
+   }
+
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      throw new UnsupportedOperationException("Using Default Handler! endParticle: " + elementName + " " + particle);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/JBossXBTestDelegate.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/JBossXBTestDelegate.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/JBossXBTestDelegate.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,170 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder;
+
+import java.lang.reflect.Method;
+import java.net.URL;
+
+import org.jboss.net.protocol.URLStreamHandlerFactory;
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+
+/**
+ * JBossXBTestDelegate.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40492 $
+ */
+public class JBossXBTestDelegate extends AbstractTestDelegate
+{
+   /** Whether initialization has been done */
+   private static boolean done = false;
+
+   /** The unmarshaller factory */
+   protected UnmarshallerFactory unmarshallerFactory;
+
+   /** The resolver */
+   protected SchemaBindingResolver defaultResolver;
+   
+   /**
+    * Initialize
+    */
+   public synchronized static void init()
+   {
+      if (done)
+         return;
+      done = true;
+      URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory());
+      URLStreamHandlerFactory.preload();
+      String handlerPkgs = System.getProperty("java.protocol.handler.pkgs");
+      if (handlerPkgs != null)
+         handlerPkgs += "|org.jboss.net.protocol";
+      else
+         handlerPkgs = "org.jboss.net.protocol";
+      System.setProperty("java.protocol.handler.pkgs", handlerPkgs);
+   }
+
+   /**
+    * Create a new JBossXBTestDelegate.
+    * 
+    * @param clazz the test class
+    */
+   public JBossXBTestDelegate(Class<?> clazz)
+   {
+      super(clazz);
+   }
+
+   @Override
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      init();
+      unmarshallerFactory = UnmarshallerFactory.newInstance();
+      initResolver();
+   }
+   
+   protected void initResolver() throws Exception
+   {
+      try
+      {
+         Method method = clazz.getMethod("initResolver", null);
+         defaultResolver = (SchemaBindingResolver) method.invoke(null, null);
+      }
+      catch (NoSuchMethodException ignored)
+      {
+         defaultResolver = new DefaultSchemaResolver();
+      }
+   }
+   
+   /**
+    * Unmarshal an object
+    * 
+    * @param url the url
+    * @param resolver the resolver
+    * @return the object
+    * @throws Exception for any error
+    */
+   public Object unmarshal(String url, SchemaBindingResolver resolver) throws Exception
+   {
+      if (resolver == null)
+         resolver = defaultResolver;
+      
+      long start = System.currentTimeMillis();
+      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+      log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms");
+      try
+      {
+         Object result = unmarshaller.unmarshal(url, resolver);
+         log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms");
+         return result;
+      }
+      catch (Exception e)
+      {
+         log.debug("Error during parsing: " + url, e);
+         throw e;
+      }
+   }
+   
+   /**
+    * Unmarshal an object
+    * 
+    * @param url the url
+    * @param schema the schema
+    * @return the object
+    * @throws Exception for any error
+    */
+   public Object unmarshal(String url, SchemaBinding schema) throws Exception
+   {
+      long start = System.currentTimeMillis();
+      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+      log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms");
+      try
+      {
+         Object result = unmarshaller.unmarshal(url, schema);
+         log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms");
+         return result;
+      }
+      catch (Exception e)
+      {
+         log.debug("Error during parsing: " + url, e);
+         throw e;
+      }
+   }
+   
+   /**
+    * Bind a schema
+    * 
+    * @param url the url
+    * @param resolver the resolver
+    * @return the object
+    * @throws Exception for any error
+    */
+   public SchemaBinding bind(String url, SchemaBindingResolver resolver) throws Exception
+   {
+      return XsdBinder.bind(url, resolver);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/TestSchemaResolver.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/TestSchemaResolver.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/TestSchemaResolver.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder;
+
+import java.util.HashMap;
+
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * TestSchemaResolver.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestSchemaResolver implements SchemaBindingResolver
+{
+   private HashMap<String, SchemaBinding> bindings = new HashMap<String, SchemaBinding>();
+   
+   public String getBaseURI()
+   {
+      return null;
+   }
+
+   public void addSchemaBinding(SchemaBinding schemaBinding)
+   {
+      schemaBinding.setSchemaResolver(this);
+      String nsURI = (String) schemaBinding.getNamespaces().iterator().next();
+      bindings.put(nsURI, schemaBinding);
+   }
+   
+   public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
+   {
+      SchemaBinding result = bindings.get(nsUri);
+      if (result == null)
+         throw new RuntimeException("Schema not bound: " + nsUri + " available: " + bindings.keySet());
+      return result;
+   }
+
+   public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   public void setBaseURI(String baseURI)
+   {
+      throw new org.jboss.util.NotImplementedException("setBaseURI");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/AbstractErrorTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/AbstractErrorTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/AbstractErrorTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object;
+
+import junit.framework.AssertionFailedError;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractErrorTest.
+ *
+ * @param <T> the expected error
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractErrorTest<T extends Throwable> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+   
+   /** The expected throwable */
+   private Class<T> expected;
+   
+   public AbstractErrorTest(String name, Class<?> root, Class<T> expected)
+   {
+      super(name);
+      this.root = root;
+      this.expected = expected;
+   }
+
+   public void testErrorUnmarshal() throws Exception
+   {
+      try
+      {
+         unmarshalObject(root);
+         fail("Should not be here");
+      }
+      catch (AssertionFailedError e)
+      {
+         throw e;
+      }
+      catch (Throwable t)
+      {
+         checkThrowable(expected, t);
+      }
+   }
+
+   public void testError() throws Exception
+   {
+      try
+      {
+         JBossXBBuilder.build(root);
+         fail("Should not be here");
+      }
+      catch (AssertionFailedError e)
+      {
+         throw e;
+      }
+      catch (Throwable t)
+      {
+         checkThrowable(expected, t);
+      }
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/ObjectTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/ObjectTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/ObjectTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.attribute.ObjectAttributeTestSuite;
+import org.jboss.test.xb.builder.object.element.ObjectElementTestSuite;
+import org.jboss.test.xb.builder.object.schema.ObjectSchemaTestSuite;
+import org.jboss.test.xb.builder.object.type.ObjectTypeTestSuite;
+
+/**
+ * ObjectTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Tests");
+
+      suite.addTest(ObjectSchemaTestSuite.suite());
+      suite.addTest(ObjectElementTestSuite.suite());
+      suite.addTest(ObjectTypeTestSuite.suite());
+      suite.addTest(ObjectAttributeTestSuite.suite());
+
+      return suite;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/ObjectAttributeTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/ObjectAttributeTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/ObjectAttributeTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute;
+
+import org.jboss.test.xb.builder.object.attribute.test.IntegerUnitTestCase;
+import org.jboss.test.xb.builder.object.attribute.test.StringUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+
+/**
+ * ObjectAttributeTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectAttributeTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Attribute Tests");
+
+      suite.addTest(StringUnitTestCase.suite());
+      suite.addTest(IntegerUnitTestCase.suite());
+      
+      // TODO test other simple types
+      // TODO other tests
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/ObjectAttributeTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/IntegerAttribute.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/IntegerAttribute.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/IntegerAttribute.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * IntegerAttribute.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntegerAttribute extends SimpleAttribute<Integer>
+{
+   @Override
+   @XmlAttribute
+   public Integer getAttribute()
+   {
+      return super.getAttribute();
+   }
+
+   @Override
+   public void setAttribute(Integer attribute)
+   {
+      super.setAttribute(attribute);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/SimpleAttribute.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/SimpleAttribute.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/SimpleAttribute.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.support;
+
+
+/**
+ * SimpleAttribute.
+ *
+ * @param <T> the attribute type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleAttribute<T>
+{
+   private T attribute;
+
+   public T getAttribute()
+   {
+      return attribute;
+   }
+
+   public void setAttribute(T attribute)
+   {
+      this.attribute = attribute;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/StringAttribute.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/StringAttribute.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/support/StringAttribute.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * StringAttribute.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StringAttribute extends SimpleAttribute<String>
+{
+   @Override
+   @XmlAttribute
+   public String getAttribute()
+   {
+      return super.getAttribute();
+   }
+
+   @Override
+   public void setAttribute(String attribute)
+   {
+      super.setAttribute(attribute);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,86 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.attribute.support.SimpleAttribute;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractAttributeTest.
+ *
+ * @param <T> the simple type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractAttributeTest<T> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+
+   /** The expected value */
+   private T expected;
+   
+   public AbstractAttributeTest(String name, Class<?> root, T expected)
+   {
+      super(name);
+      this.root = root;
+      this.expected = expected;
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testUnmarshal() throws Exception
+   {
+      SimpleAttribute result = (SimpleAttribute) unmarshalObject(root);
+      T actual = (T) result.getAttribute();
+      assertEquals(expected, actual);
+   }
+
+   public void testSimpleAttribute() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      assertNotNull(schemaBinding);
+
+      QName qName = SimpleTypeBindings.typeQName(expected.getClass());
+      assertNotNull(qName);
+      TypeBinding expectedTypeBinding = schemaBinding.getType(qName);
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, JBossXBBuilder.generateXMLNameFromJavaName(root.getSimpleName(), true, true));
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      assertNotNull(typeBinding);
+      QName attributeName = new QName(XMLConstants.NULL_NS_URI, "attribute");
+      AttributeBinding attribute = typeBinding.getAttribute(attributeName);
+      assertNotNull(attribute);
+      TypeBinding attributeType = attribute.getType();
+      assertTrue("Expected " + expectedTypeBinding + " got " + attributeType, expectedTypeBinding == attributeType);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/IntegerUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/IntegerUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/IntegerUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.attribute.support.IntegerAttribute;
+
+/**
+ * IntegerUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntegerUnitTestCase extends AbstractAttributeTest<Integer>
+{
+   public static Test suite()
+   {
+      return suite(IntegerUnitTestCase.class);
+   }
+   
+   public IntegerUnitTestCase(String name)
+   {
+      super(name, IntegerAttribute.class, new Integer(4));
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/StringUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/StringUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/attribute/test/StringUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.attribute.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.attribute.support.StringAttribute;
+
+/**
+ * StringUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StringUnitTestCase extends AbstractAttributeTest<String>
+{
+   public static Test suite()
+   {
+      return suite(StringUnitTestCase.class);
+   }
+   
+   public StringUnitTestCase(String name)
+   {
+      super(name, StringAttribute.class, "hello");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/ObjectElementTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/ObjectElementTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/ObjectElementTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.ObjectXmlElementTestSuite;
+import org.jboss.test.xb.builder.object.element.xmlrootelement.ObjectXmlRootElementTestSuite;
+
+/**
+ * ObjectElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectElementTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Element Tests");
+
+      suite.addTest(ObjectXmlRootElementTestSuite.suite());
+      suite.addTest(ObjectXmlElementTestSuite.suite());
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/ObjectElementTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/ObjectXmlElementTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/ObjectXmlElementTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/ObjectXmlElementTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.element.xmlelement.test.NonDefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.element.xmlelement.test.NoneUnitTestCase;
+
+/**
+ * ObjectXmlElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectXmlElementTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object XMLElement Tests");
+
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+
+      // TODO test semantics
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/ObjectXmlElementTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/SimpleElement.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/SimpleElement.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/SimpleElement.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.support;
+
+/**
+ * SimpleElement.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface SimpleElement
+{
+   Object getElement();
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/defaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/defaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/defaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.support.defaults;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.support.SimpleElement;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root implements SimpleElement
+{
+   private String element;
+   
+   @XmlElement
+   public String getElement()
+   {
+      return element;
+   }
+   
+   public void setElement(String element)
+   {
+      this.element = element;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/nondefaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/nondefaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/nondefaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.support.nondefaults;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.support.SimpleElement;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root implements SimpleElement
+{
+   private String element;
+   
+   @XmlElement(namespace="testNamespace", name="local")
+   public String getElement()
+   {
+      return element;
+   }
+   
+   public void setElement(String element)
+   {
+      this.element = element;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/none/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/none/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/support/none/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.support.none;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.support.SimpleElement;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root implements SimpleElement
+{
+   private String element;
+   
+   public String getElement()
+   {
+      return element;
+   }
+   
+   public void setElement(String element)
+   {
+      this.element = element;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,80 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.element.xmlelement.support.SimpleElement;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * SimpleObjectWildcardUnitTestCase.
+ * 
+ * @param <T> the unmarshalled type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest<T extends SimpleElement> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<T> root;
+   
+   /** The expected element */
+   private Object expected;
+   
+   public AbstractDefaultsTest(String name, Class<T> root, Object expected)
+   {
+      super(name);
+      this.root = root;
+      this.expected = expected;
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      T result = unmarshalObject(root);
+      Object actual = result.getElement();
+      assertEquals(expected, actual);
+   }
+
+   public void testDefaultsElementBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the element
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "root");
+      ElementBinding elementBinding = schemaBinding.getElement(qName);
+      assertNotNull(elementBinding);
+      assertEquals(qName, elementBinding.getQName());
+      
+      // TODO check type's elements
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.test;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.support.defaults.Root;
+
+import junit.framework.Test;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest<Root>
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Root.class, "Hello");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.element.xmlelement.support.nondefaults.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      Root root = unmarshalObject(Root.class);
+      String result = root.getElement();
+      assertEquals("Hello", result);
+   }
+
+   public void testNonDefaultsElementBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Root.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the element
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "root");
+      ElementBinding elementBinding = schemaBinding.getElement(qName);
+      assertNotNull(elementBinding);
+      assertEquals(qName, elementBinding.getQName());
+      
+      // TODO check type's elements
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlelement/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlelement.test;
+
+import org.jboss.test.xb.builder.object.element.xmlelement.support.none.Root;
+
+import junit.framework.Test;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest<Root>
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, Root.class, "Hello");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/ObjectXmlRootElementTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/ObjectXmlRootElementTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/ObjectXmlRootElementTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test.NonDefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test.NoneUnitTestCase;
+
+/**
+ * ObjectXmlElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectXmlRootElementTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object XMLRootElement Tests");
+
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+
+      // TODO non specified xml root element
+      // TODO test semantics
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/ObjectXmlRootElementTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/defaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/defaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/defaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.defaults;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/nondefaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/nondefaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/nondefaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.nondefaults;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement(namespace="testNamespace", name="nondefaults")
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/none/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/none/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/support/none/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.none;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,70 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * SimpleObjectWildcardUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+   
+   public AbstractDefaultsTest(String name, Class<?> root)
+   {
+      super(name);
+      this.root = root;
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(root);
+   }
+
+   public void testDefaultsElementBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the element
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "root");
+      ElementBinding elementBinding = schemaBinding.getElement(qName);
+      assertNotNull(elementBinding);
+      assertEquals(qName, elementBinding.getQName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test;
+
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.defaults.Root;
+
+import junit.framework.Test;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.nondefaults.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(Root.class);
+   }
+
+   public void testNonDefaultsElementBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Root.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the element
+      QName qName = new QName("testNamespace", "nondefaults");
+      ElementBinding elementBinding = schemaBinding.getElement(qName);
+      assertNotNull(elementBinding);
+      assertEquals(qName, elementBinding.getQName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.element.xmlrootelement.specified.test;
+
+import org.jboss.test.xb.builder.object.element.xmlrootelement.specified.support.none.Root;
+
+import junit.framework.Test;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/ObjectJBossXmlSchemaTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/ObjectJBossXmlSchemaTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/ObjectJBossXmlSchemaTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema;
+
+import org.jboss.test.xb.builder.object.jbossxmlschema.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.jbossxmlschema.test.NoneUnitTestCase;
+import org.jboss.test.xb.builder.object.jbossxmlschema.test.NonDefaultsUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * ObjectJBossXMLSchemaTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectJBossXmlSchemaTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object JBossXmlSchema Tests");
+
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+      
+      return suite;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/Defaults.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/Defaults.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/Defaults.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.support;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * Defaults
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema
+public class Defaults
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/NonDefaults.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/NonDefaults.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/NonDefaults.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.support;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * NonDefaults
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(namespace = "testNamespace", ignoreLowLine=false, ignoreUnresolvedFieldOrClass=false, packageName="testPackage", replacePropertyRefs=false)
+public class NonDefaults
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/None.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/None.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/support/None.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.support;
+
+/**
+ * None
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class None
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.test;
+
+import java.util.Collections;
+
+import javax.xml.XMLConstants;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractErrorTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+   
+   public AbstractDefaultsTest(String name, Class<?> root)
+   {
+      super(name);
+      this.root = root;
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(root);
+   }
+
+   public void testDefaultsSchemaBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the annotation values
+      assertEquals(Collections.singleton(XMLConstants.NULL_NS_URI), schemaBinding.getNamespaces());
+      assertTrue(schemaBinding.isIgnoreUnresolvedFieldOrClass());
+      assertTrue(schemaBinding.isIgnoreLowLine());
+      assertTrue(schemaBinding.isReplacePropertyRefs());
+      assertEquals(root.getPackage().getName(), schemaBinding.getPackageMetaData().getName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.jbossxmlschema.support.Defaults;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Defaults.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.test;
+
+import java.util.Collections;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.jbossxmlschema.support.NonDefaults;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(NonDefaults.class);
+   }
+
+   public void testNonDefaultsSchemaBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(NonDefaults.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the annotation values
+      assertEquals(Collections.singleton("testNamespace"), schemaBinding.getNamespaces());
+      assertFalse(schemaBinding.isIgnoreUnresolvedFieldOrClass());
+      assertFalse(schemaBinding.isIgnoreLowLine());
+      assertFalse(schemaBinding.isReplacePropertyRefs());
+      assertEquals("testPackage", schemaBinding.getPackageMetaData().getName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/jbossxmlschema/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.jbossxmlschema.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.jbossxmlschema.support.None;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, None.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/ObjectSchemaTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/ObjectSchemaTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/ObjectSchemaTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.schema;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.jbossxmlschema.ObjectJBossXmlSchemaTestSuite;
+import org.jboss.test.xb.builder.object.xmlschema.ObjectXmlSchemaTestSuite;
+
+/**
+ * ObjectXmlElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectSchemaTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Schema Tests");
+
+      suite.addTest(ObjectJBossXmlSchemaTestSuite.suite());
+      suite.addTest(ObjectXmlSchemaTestSuite.suite());
+
+      // TODO test XmlSchemaType(s)
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/schema/ObjectSchemaTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/ObjectTypeTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/ObjectTypeTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/ObjectTypeTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.accessor.ObjectTypeAccessorTestSuite;
+import org.jboss.test.xb.builder.object.type.collection.ObjectTypeCollectionTestSuite;
+import org.jboss.test.xb.builder.object.type.simple.ObjectTypeSimpleTestSuite;
+import org.jboss.test.xb.builder.object.type.value.ObjectTypeValueTestSuite;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.ObjectTypeXmlAnyElementTestSuite;
+import org.jboss.test.xb.builder.object.type.xmlenum.ObjectTypeXmlEnumTestSuite;
+import org.jboss.test.xb.builder.object.type.xmltransient.ObjectTypeXmlTransientTestSuite;
+import org.jboss.test.xb.builder.object.type.xmltype.ObjectTypeXmlTypeTestSuite;
+
+/**
+ * ObjectTypeXmlTypeTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type Tests");
+
+      suite.addTest(ObjectTypeXmlTypeTestSuite.suite());
+      suite.addTest(ObjectTypeXmlEnumTestSuite.suite());
+      suite.addTest(ObjectTypeSimpleTestSuite.suite());
+      suite.addTest(ObjectTypeCollectionTestSuite.suite());
+      suite.addTest(ObjectTypeValueTestSuite.suite());
+      suite.addTest(ObjectTypeXmlAnyElementTestSuite.suite());
+      suite.addTest(ObjectTypeXmlTransientTestSuite.suite());
+      suite.addTest(ObjectTypeAccessorTestSuite.suite());
+
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/ObjectTypeTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/ObjectTypeAccessorTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/ObjectTypeAccessorTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/ObjectTypeAccessorTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.accessor.test.AllUnitTestCase;
+import org.jboss.test.xb.builder.object.type.accessor.test.AlphaUnitTestCase;
+import org.jboss.test.xb.builder.object.type.accessor.test.SequenceUnitTestCase;
+
+/**
+ * ObjectTypeAccessorTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeAccessorTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type Accessor Tests");
+
+      suite.addTest(AllUnitTestCase.suite());
+      suite.addTest(SequenceUnitTestCase.suite());
+      suite.addTest(AlphaUnitTestCase.suite());
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/ObjectTypeAccessorTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/All.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/All.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/All.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.support;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * All.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(propOrder={})
+public class All extends Bean
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Alpha.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Alpha.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Alpha.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.support;
+
+import javax.xml.bind.annotation.XmlAccessOrder;
+import javax.xml.bind.annotation.XmlAccessorOrder;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Alpha.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
+ at XmlType
+public class Alpha extends Bean
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Bean.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Bean.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Bean.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.support;
+
+/**
+ * Bean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bean
+{
+   private String one;
+   
+   private String two;
+   
+   private String three;
+
+   public String getOne()
+   {
+      return one;
+   }
+
+   public void setOne(String one)
+   {
+      this.one = one;
+   }
+
+   public String getThree()
+   {
+      return three;
+   }
+
+   public void setThree(String three)
+   {
+      this.three = three;
+   }
+
+   public String getTwo()
+   {
+      return two;
+   }
+
+   public void setTwo(String two)
+   {
+      this.two = two;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Sequence.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Sequence.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/support/Sequence.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.support;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Sequence.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(propOrder={ "three", "two", "one" })
+public class Sequence extends Bean
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,98 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.test;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.accessor.support.All;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AllUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(AllUnitTestCase.class);
+   }
+   
+   public AllUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      All all = unmarshalObject(All.class);
+      assertEquals("one", all.getOne());
+      assertEquals("two", all.getTwo());
+      assertEquals("three", all.getThree());
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(All.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "all");
+      TypeBinding typeBinding = schemaBinding.getType(qName);
+      assertNotNull(typeBinding);
+      ParticleBinding particle = typeBinding.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof AllBinding);
+      AllBinding all = (AllBinding) term;
+      Set<QName> elements = new HashSet<QName>();
+      Collection<ParticleBinding> particles = all.getParticles();
+      for (ParticleBinding p : particles)
+      {
+         term = p.getTerm();
+         assertTrue(term instanceof ElementBinding);
+         elements.add(((ElementBinding) term).getQName());
+      }
+      HashSet<QName> expected = new HashSet();
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
+      assertEquals(expected, elements);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,98 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.accessor.support.Alpha;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AlphaUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AlphaUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(AlphaUnitTestCase.class);
+   }
+   
+   public AlphaUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      Alpha alpha = unmarshalObject(Alpha.class);
+      assertEquals("one", alpha.getOne());
+      assertEquals("two", alpha.getTwo());
+      assertEquals("three", alpha.getThree());
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Alpha.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "alpha");
+      TypeBinding typeBinding = schemaBinding.getType(qName);
+      assertNotNull(typeBinding);
+      ParticleBinding particle = typeBinding.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      SequenceBinding sequence = (SequenceBinding) term;
+      List<QName> elements = new ArrayList<QName>();
+      Collection<ParticleBinding> particles = sequence.getParticles();
+      for (ParticleBinding p : particles)
+      {
+         term = p.getTerm();
+         assertTrue(term instanceof ElementBinding);
+         elements.add(((ElementBinding) term).getQName());
+      }
+      ArrayList<QName> expected = new ArrayList();
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
+      assertEquals(expected, elements);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,98 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.accessor.test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.accessor.support.Sequence;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * SequenceUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SequenceUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(SequenceUnitTestCase.class);
+   }
+   
+   public SequenceUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      Sequence sequence = unmarshalObject(Sequence.class);
+      assertEquals("one", sequence.getOne());
+      assertEquals("two", sequence.getTwo());
+      assertEquals("three", sequence.getThree());
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Sequence.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "sequence");
+      TypeBinding typeBinding = schemaBinding.getType(qName);
+      assertNotNull(typeBinding);
+      ParticleBinding particle = typeBinding.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      SequenceBinding sequence = (SequenceBinding) term;
+      List<QName> elements = new ArrayList<QName>();
+      Collection<ParticleBinding> particles = sequence.getParticles();
+      for (ParticleBinding p : particles)
+      {
+         term = p.getTerm();
+         assertTrue(term instanceof ElementBinding);
+         elements.add(((ElementBinding) term).getQName());
+      }
+      ArrayList<QName> expected = new ArrayList();
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
+      expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
+      assertEquals(expected, elements);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/ObjectTypeCollectionTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/ObjectTypeCollectionTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/ObjectTypeCollectionTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.collection.test.ArrayListUnitTestCase;
+import org.jboss.test.xb.builder.object.type.collection.test.ArrayUnitTestCase;
+import org.jboss.test.xb.builder.object.type.collection.test.HashSetUnitTestCase;
+
+/**
+ * ObjectTypeCollectionTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeCollectionTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type Collection Tests");
+
+      suite.addTest(ArrayListUnitTestCase.suite());
+      suite.addTest(HashSetUnitTestCase.suite());
+      suite.addTest(ArrayUnitTestCase.suite());
+      // TODO lots of other tests
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/ObjectTypeCollectionTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.support;
+
+import java.util.Collection;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @param <T> the expected type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root<T extends Collection<String>>
+{
+   private T collection;
+
+   public T getCollection()
+   {
+      return collection;
+   }
+
+   public void setCollection(T collection)
+   {
+      this.collection = collection;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArray.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArray.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArray.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.support;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootArray
+{
+   private String[] array;
+
+   public String[] getArray()
+   {
+      return array;
+   }
+
+   public void setArray(String[] array)
+   {
+      this.array = array;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArrayList.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArrayList.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootArrayList.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.support;
+
+import java.util.ArrayList;
+
+/**
+ * RootArrayList.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootArrayList extends Root<ArrayList<String>>
+{
+   @Override
+   public ArrayList<String> getCollection()
+   {
+      return super.getCollection();
+   }
+
+   @Override
+   public void setCollection(ArrayList<String> collection)
+   {
+      super.setCollection(collection);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootHashSet.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootHashSet.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/support/RootHashSet.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.support;
+
+import java.util.LinkedHashSet;
+
+/**
+ * RootHashSet.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootHashSet extends Root<LinkedHashSet<String>>
+{
+   @Override
+   public LinkedHashSet<String> getCollection()
+   {
+      return super.getCollection();
+   }
+
+   @Override
+   public void setCollection(LinkedHashSet<String> collection)
+   {
+      super.setCollection(collection);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/AbstractCollectionTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/AbstractCollectionTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/AbstractCollectionTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.collection.support.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractCollectionTest
+ *
+ * @param <T> the test class
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractCollectionTest<T extends Root<Collection<String>>> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<T> root;
+
+   /** The expected value */
+   private ArrayList<String> expected;
+   
+   public AbstractCollectionTest(String name, Class<T> root)
+   {
+      super(name);
+      this.root = root;
+      this.expected = new ArrayList<String>();
+      expected.add("ONE");
+      expected.add("TWO");
+      expected.add("THREE");
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testUnmarshal() throws Exception
+   {
+      T result = unmarshalObject(root);
+      Collection<String> collection = result.getCollection();
+      Collection<String> actual = new ArrayList<String>(collection);
+      assertEquals(expected, actual);
+   }
+
+   public void testSimpleBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      assertNotNull(schemaBinding);
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, JBossXBBuilder.generateXMLNameFromJavaName(root.getSimpleName(), true, true));
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      
+      // TODO check the collection model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayListUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayListUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayListUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.collection.support.RootArrayList;
+
+/**
+ * ArrayListUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at SuppressWarnings("unchecked")
+public class ArrayListUnitTestCase extends AbstractCollectionTest
+{
+   public static Test suite()
+   {
+      return suite(ArrayListUnitTestCase.class);
+   }
+   
+   public ArrayListUnitTestCase(String name)
+   {
+      super(name, RootArrayList.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/ArrayUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.collection.support.RootArray;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * ArrayUnitTestCase
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ArrayUnitTestCase.class);
+   }
+
+   public ArrayUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   @SuppressWarnings("unchecked")
+   public void testUnmarshal() throws Exception
+   {
+      RootArray result = unmarshalObject(RootArray.class);
+      String[] array = result.getArray();
+      assertNotNull(array);
+      assertEquals(new String[] { "ONE", "TWO", "THREE" }, array);
+   }
+
+   public void testSimpleBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(RootArray.class);
+      assertNotNull(schemaBinding);
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, "root-array");
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      
+      // TODO check the collection model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/HashSetUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/HashSetUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/collection/test/HashSetUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.collection.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.collection.support.RootHashSet;
+
+/**
+ * HashSetUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at SuppressWarnings("unchecked")
+public class HashSetUnitTestCase extends AbstractCollectionTest
+{
+   public static Test suite()
+   {
+      return suite(HashSetUnitTestCase.class);
+   }
+   
+   public HashSetUnitTestCase(String name)
+   {
+      super(name, RootHashSet.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/ObjectTypeSimpleTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/ObjectTypeSimpleTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/ObjectTypeSimpleTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.simple;
+
+import org.jboss.test.xb.builder.object.type.simple.test.IntegerUnitTestCase;
+import org.jboss.test.xb.builder.object.type.simple.test.StringUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * ObjectTypeAccessorTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeSimpleTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type Simple Tests");
+
+      suite.addTest(StringUnitTestCase.suite());
+      suite.addTest(IntegerUnitTestCase.suite());
+      // TODO test all simple types
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/ObjectTypeSimpleTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/AbstractSimpleTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/AbstractSimpleTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/AbstractSimpleTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.simple.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractSimpleTest.
+ *
+ * @param <T> the simple type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractSimpleTest<T> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<T> root;
+
+   /** The expected value */
+   private T expected;
+   
+   public AbstractSimpleTest(String name, Class<T> root, T expected)
+   {
+      super(name);
+      this.root = root;
+      this.expected = expected;
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      T result = unmarshalObject(root);
+      assertEquals(expected, result);
+   }
+
+   public void testSimpleBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      assertNotNull(schemaBinding);
+
+      QName qName = SimpleTypeBindings.typeQName(root);
+      assertNotNull(qName);
+      TypeBinding expectedTypeBinding = schemaBinding.getType(qName);
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, JBossXBBuilder.generateXMLNameFromJavaName(root.getSimpleName(), true, true));
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      assertTrue(expectedTypeBinding == elementBinding.getType());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/IntegerUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/IntegerUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/IntegerUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.simple.test;
+
+import junit.framework.Test;
+
+/**
+ * IntegerUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntegerUnitTestCase extends AbstractSimpleTest<Integer>
+{
+   public static Test suite()
+   {
+      return suite(IntegerUnitTestCase.class);
+   }
+   
+   public IntegerUnitTestCase(String name)
+   {
+      super(name, Integer.class, new Integer(4));
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/StringUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/StringUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/simple/test/StringUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.simple.test;
+
+import junit.framework.Test;
+
+/**
+ * StringUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StringUnitTestCase extends AbstractSimpleTest<String>
+{
+   public static Test suite()
+   {
+      return suite(StringUnitTestCase.class);
+   }
+   
+   public StringUnitTestCase(String name)
+   {
+      super(name, String.class, "hello");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/ObjectTypeValueTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/ObjectTypeValueTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/ObjectTypeValueTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.value.test.IntegerUnitTestCase;
+import org.jboss.test.xb.builder.object.type.value.test.NotSpecifiedValueUnitTestCase;
+import org.jboss.test.xb.builder.object.type.value.test.SpecifiedValueUnitTestCase;
+import org.jboss.test.xb.builder.object.type.value.test.StringUnitTestCase;
+
+/**
+ * ObjectTypeXmlTransientTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeValueTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type Value Tests");
+
+      suite.addTest(NotSpecifiedValueUnitTestCase.suite());
+      suite.addTest(SpecifiedValueUnitTestCase.suite());
+      suite.addTest(StringUnitTestCase.suite());
+      suite.addTest(IntegerUnitTestCase.suite());
+      // TODO test all simple types
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/ObjectTypeValueTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/IntegerValue.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/IntegerValue.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/IntegerValue.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.support;
+
+/**
+ * IntegerValue.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntegerValue implements SimpleValue
+{
+   private Integer value;
+
+   public Integer getValue()
+   {
+      return value;
+   }
+   public void setValue(Integer value)
+   {
+      this.value = value;
+   } 
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SimpleValue.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SimpleValue.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SimpleValue.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.support;
+
+/**
+ * SimpleValue.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface SimpleValue
+{
+   Object getValue();
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SpecifiedValue.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SpecifiedValue.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/SpecifiedValue.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.support;
+
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * SpecifiedValue.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SpecifiedValue
+{
+   private String value;
+
+   public String getValue()
+   {
+      throw new UnsupportedOperationException("Not the value");
+   }
+
+   public void setValue(String value)
+   {
+      throw new UnsupportedOperationException("Not the value");
+   }
+
+   @XmlValue
+   public String getNotValue()
+   {
+      return value;
+   }
+
+   public void setNotValue(String value)
+   {
+      this.value = value;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/StringValue.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/StringValue.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/support/StringValue.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.support;
+
+/**
+ * StringValue.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StringValue implements SimpleValue
+{
+   private String value;
+
+   public String getValue()
+   {
+      return value;
+   }
+
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/AbstractValueTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/AbstractValueTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/AbstractValueTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.value.support.SimpleValue;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AllUnitTestCase.
+ *
+ * @param <T> the simple value type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractValueTest<T extends SimpleValue> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<T> root;
+
+   /** The expected value */
+   private Object expected;
+   
+   public AbstractValueTest(String name, Class<T> root, Object expected)
+   {
+      super(name);
+      this.root = root;
+      this.expected = expected;
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      T result = unmarshalObject(root);
+      Object actual = result.getValue();
+      assertEquals(expected, actual);
+   }
+
+   public void testValueBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      assertNotNull(schemaBinding);
+      
+      // TODO check the model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/IntegerUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/IntegerUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/IntegerUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.value.support.IntegerValue;
+
+/**
+ * IntegerUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntegerUnitTestCase extends AbstractValueTest<IntegerValue>
+{
+   public static Test suite()
+   {
+      return suite(IntegerUnitTestCase.class);
+   }
+   
+   public IntegerUnitTestCase(String name)
+   {
+      super(name, IntegerValue.class, new Integer(4));
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValueUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValueUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValueUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.value.support.StringValue;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * NotSpecifiedValueUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NotSpecifiedValueUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NotSpecifiedValueUnitTestCase.class);
+   }
+
+   public NotSpecifiedValueUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      StringValue result = unmarshalObject(StringValue.class);
+      Object actual = result.getValue();
+      assertEquals("Hello", actual);
+   }
+
+   public void testValueBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(StringValue.class);
+      assertNotNull(schemaBinding);
+      
+      // TODO check the model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValueUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValueUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValueUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.value.support.SpecifiedValue;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * SpecifiedValueUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SpecifiedValueUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(SpecifiedValueUnitTestCase.class);
+   }
+
+   public SpecifiedValueUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      SpecifiedValue result = unmarshalObject(SpecifiedValue.class);
+      Object actual = result.getNotValue();
+      assertEquals("Hello", actual);
+   }
+
+   public void testValueBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(SpecifiedValue.class);
+      assertNotNull(schemaBinding);
+      
+      // TODO check the model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/StringUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/StringUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/value/test/StringUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.value.test;
+
+import org.jboss.test.xb.builder.object.type.value.support.StringValue;
+
+import junit.framework.Test;
+
+/**
+ * StringUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StringUnitTestCase extends AbstractValueTest<StringValue>
+{
+   public static Test suite()
+   {
+      return suite(StringUnitTestCase.class);
+   }
+   
+   public StringUnitTestCase(String name)
+   {
+      super(name, StringValue.class, "Hello");
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/ObjectTypeXmlAnyElementTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/ObjectTypeXmlAnyElementTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/ObjectTypeXmlAnyElementTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.ArrayElementWildcardUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.ArrayObjectWildcardUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.ElementWildcardUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.ListElementWildcardUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.ListObjectWildcardUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.test.SimpleObjectWildcardUnitTestCase;
+
+/**
+ * ObjectTypeXmlAnyElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeXmlAnyElementTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type XmlAnyElement Tests");
+
+      suite.addTest(SimpleObjectWildcardUnitTestCase.suite());
+      suite.addTest(ArrayObjectWildcardUnitTestCase.suite());
+      suite.addTest(ListObjectWildcardUnitTestCase.suite());
+      suite.addTest(ElementWildcardUnitTestCase.suite());
+      suite.addTest(ArrayElementWildcardUnitTestCase.suite());
+      suite.addTest(ListElementWildcardUnitTestCase.suite());
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/ObjectTypeXmlAnyElementTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/AnotherJavaBean.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/AnotherJavaBean.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/AnotherJavaBean.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * AnotherJavaBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(namespace="urn:AnotherJavaBean")
+public class AnotherJavaBean
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayElementWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayElementWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayElementWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+import org.w3c.dom.Element;
+
+/**
+ * ArrayElementWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayElementWildcard
+{
+   private Element[] wildcard;
+
+   public Element[] getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement(lax=true)
+   public void setWildcard(Element[] wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayObjectWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayObjectWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ArrayObjectWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+/**
+ * ArrayObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayObjectWildcard
+{
+   private Object[] wildcard;
+
+   public Object[] getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement
+   public void setWildcard(Object[] wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ElementWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ElementWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ElementWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+import org.w3c.dom.Element;
+
+/**
+ * ElementWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ElementWildcard
+{
+   private Element wildcard;
+
+   public Element getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement(lax=true)
+   public void setWildcard(Element wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListElementWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListElementWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListElementWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+import org.w3c.dom.Element;
+
+/**
+ * ListElementWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ListElementWildcard
+{
+   private List<Element> wildcard;
+
+   public List<Element> getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement(lax=true)
+   public void setWildcard(List<Element> wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListObjectWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListObjectWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/ListObjectWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+/**
+ * ListObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ListObjectWildcard
+{
+   private List<Object> wildcard;
+
+   public List<Object> getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement
+   public void setWildcard(List<Object> wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleJavaBean.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleJavaBean.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleJavaBean.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * SimpleJavaBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(namespace="urn:SimpleJavaBean")
+public class SimpleJavaBean
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleObjectWildcard.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleObjectWildcard.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/support/SimpleObjectWildcard.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.support;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+/**
+ * SimpleObjectWildcard.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleObjectWildcard
+{
+   private Object wildcard;
+
+   public Object getWildcard()
+   {
+      return wildcard;
+   }
+
+   @XmlAnyElement
+   public void setWildcard(Object wildcard)
+   {
+      this.wildcard = wildcard;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.ArrayElementWildcard;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.ArraySequenceBinding;
+import org.jboss.xb.builder.runtime.DOMHandler;
+import org.jboss.xb.builder.runtime.PropertyWildcardHandler;
+import org.w3c.dom.Element;
+
+/**
+ * ArrayElementWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayElementWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ArrayElementWildcardUnitTestCase.class);
+   }
+   
+   public ArrayElementWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      ArrayElementWildcard result = unmarshalObject(ArrayElementWildcard.class);
+      Element[] wildcard = result.getWildcard();
+      assertNotNull(wildcard);
+      assertEquals(2, wildcard.length);
+      assertEquals("test-element-1", wildcard[0].getNodeName());
+      assertEquals("test-element-2", wildcard[1].getNodeName());
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(ArrayElementWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "array-element-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof ArraySequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsLax());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof PropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,101 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.AnotherJavaBean;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.ArrayObjectWildcard;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.SimpleJavaBean;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.ArraySequenceBinding;
+import org.jboss.xb.builder.runtime.PropertyWildcardHandler;
+
+/**
+ * ArrayObjectWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ArrayObjectWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ArrayObjectWildcardUnitTestCase.class);
+   }
+   
+   public ArrayObjectWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      ArrayObjectWildcard result = unmarshalObject(ArrayObjectWildcard.class, SimpleJavaBean.class, AnotherJavaBean.class);
+      Object[] wildcard = result.getWildcard();
+      assertNotNull(wildcard);
+      assertEquals(2, wildcard.length);
+      assertTrue(wildcard[0] instanceof SimpleJavaBean);
+      assertTrue(wildcard[1] instanceof AnotherJavaBean);
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(ArrayObjectWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "array-object-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof ArraySequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsStrict());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof PropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.ElementWildcard;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.DOMHandler;
+import org.jboss.xb.builder.runtime.PropertyWildcardHandler;
+import org.w3c.dom.Element;
+
+/**
+ * ElementWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ElementWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ElementWildcardUnitTestCase.class);
+   }
+   
+   public ElementWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      ElementWildcard result = unmarshalObject(ElementWildcard.class);
+      Element element = result.getWildcard();
+      assertNotNull(element);
+      assertEquals("test-element", element.getNodeName());
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(ElementWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "element-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsLax());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof PropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,103 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.ListElementWildcard;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.CollectionPropertyWildcardHandler;
+import org.jboss.xb.builder.runtime.DOMHandler;
+import org.w3c.dom.Element;
+
+/**
+ * ListElementWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ListElementWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ListElementWildcardUnitTestCase.class);
+   }
+   
+   public ListElementWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      ListElementWildcard result = unmarshalObject(ListElementWildcard.class);
+      List<Element> wildcard = result.getWildcard();
+      assertNotNull(wildcard);
+      assertEquals(2, wildcard.size());
+      assertEquals("test-element-1", wildcard.get(0).getNodeName());
+      assertEquals("test-element-2", wildcard.get(1).getNodeName());
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(ListElementWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "list-element-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsLax());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
+      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof CollectionPropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.AnotherJavaBean;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.ListObjectWildcard;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.SimpleJavaBean;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.CollectionPropertyWildcardHandler;
+
+/**
+ * ListObjectWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ListObjectWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(ListObjectWildcardUnitTestCase.class);
+   }
+   
+   public ListObjectWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      ListObjectWildcard result = unmarshalObject(ListObjectWildcard.class, SimpleJavaBean.class, AnotherJavaBean.class);
+      List<Object> wildcard = result.getWildcard();
+      assertNotNull(wildcard);
+      assertEquals(2, wildcard.size());
+      assertTrue(wildcard.get(0) instanceof SimpleJavaBean);
+      assertTrue(wildcard.get(1) instanceof AnotherJavaBean);
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(ListObjectWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "list-object-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsStrict());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof CollectionPropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcardUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcardUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcardUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlanyelement.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.SimpleJavaBean;
+import org.jboss.test.xb.builder.object.type.xmlanyelement.support.SimpleObjectWildcard;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.PropertyWildcardHandler;
+
+/**
+ * SimpleObjectWildcardUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleObjectWildcardUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(SimpleObjectWildcardUnitTestCase.class);
+   }
+   
+   public SimpleObjectWildcardUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalWildcard() throws Exception
+   {
+      SimpleObjectWildcard result = unmarshalObject(SimpleObjectWildcard.class, SimpleJavaBean.class);
+      Object object = result.getWildcard();
+      assertNotNull(object);
+      assertTrue(object instanceof SimpleJavaBean);
+   }
+
+   public void testWildcardBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(SimpleObjectWildcard.class);
+      assertNotNull(schemaBinding);
+      
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "simple-object-wildcard");
+      ElementBinding element = schemaBinding.getElement(qName);
+      assertNotNull(element);
+      TypeBinding type = element.getType();
+      assertNotNull(type);
+      ParticleBinding particle = type.getParticle();
+      assertNotNull(particle);
+      TermBinding term = particle.getTerm();
+      assertNotNull(term);
+      assertTrue(term instanceof SequenceBinding);
+      term = assertSingleSequence(term);
+      assertTrue(term instanceof WildcardBinding);
+      WildcardBinding wildcardBinding = type.getWildcard();
+      assertNotNull(wildcardBinding);
+      assertTrue(term == wildcardBinding);
+      assertTrue(wildcardBinding.isProcessContentsStrict());
+      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof PropertyWildcardHandler);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/ObjectTypeXmlEnumTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/ObjectTypeXmlEnumTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/ObjectTypeXmlEnumTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.xmlenum.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlenum.test.EnumConstantUnconvertableUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlenum.test.EnumGlobalTypeUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlenum.test.EnumNotSimpleUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlenum.test.NonDefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmlenum.test.NoneUnitTestCase;
+
+/**
+ * ObjectTypeXmlAnyElementTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeXmlEnumTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type XmlEnum Tests");
+
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+      suite.addTest(EnumGlobalTypeUnitTestCase.suite());
+      suite.addTest(EnumNotSimpleUnitTestCase.suite());
+      suite.addTest(EnumConstantUnconvertableUnitTestCase.suite());
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/ObjectTypeXmlEnumTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumConstantUnconvertable.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumConstantUnconvertable.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumConstantUnconvertable.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlEnum(Integer.class)
+public enum EnumConstantUnconvertable
+{
+   ONE,
+   TWO,
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumGlobalType.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumGlobalType.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumGlobalType.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType
+public enum EnumGlobalType
+{
+   ONE,
+   TWO,
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumNotSimple.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumNotSimple.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/EnumNotSimple.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlEnum(value=Class.class)
+public enum EnumNotSimple
+{
+   ONE,
+   TWO,
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/defaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/defaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/defaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support.defaults;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlEnum
+public enum Root
+{
+   ONE,
+   TWO,
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/nondefaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/nondefaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/nondefaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support.nondefaults;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlEnum(Integer.class)
+public enum Root
+{
+   @XmlEnumValue("1")
+   ONE,
+   @XmlEnumValue("2")
+   TWO,
+   @XmlEnumValue("3")
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/none/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/none/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/none/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.support.none;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public enum Root
+{
+   ONE,
+   TWO,
+   THREE,
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.EnumValueAdapter;
+
+/**
+ * AbstractDefaultsTest.
+ *
+ * @param <T> the enumeration type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest<T extends Enum<T>> extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<T> root;
+   
+   /** The expected mapping */
+   private Map<Object, Object> expected = new HashMap<Object, Object>();
+   
+   public AbstractDefaultsTest(String name, Class<T> root)
+   {
+      super(name);
+      this.root = root;
+      
+      T[] constants = root.getEnumConstants();
+      for (int i = 0; i < constants.length; ++i)
+         expected.put(constants[i].name(), constants[i]);
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      T result = unmarshalObject(root);
+      assertTrue(expected.get("ONE") == result);
+   }
+
+   public void testDefaultsEnumBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the type
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "root");
+      QName elementName = qName;
+      TypeBinding type = schemaBinding.getType(qName);
+      assertNull(type);
+      
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      
+      ValueAdapter valueAdapter = typeBinding.getValueAdapter();
+      assertNotNull(valueAdapter);
+      assertTrue(valueAdapter instanceof EnumValueAdapter);
+      EnumValueAdapter enumValueAdapter = (EnumValueAdapter) valueAdapter;
+      
+      Map<Object, Object> actual = enumValueAdapter.getMapping();
+      assertEquals(expected, actual);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.xmlenum.support.defaults.Root;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest<Root>
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.AbstractErrorTest;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumConstantUnconvertable;
+
+/**
+ * EnumConstantUnconvertableUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EnumConstantUnconvertableUnitTestCase extends AbstractErrorTest<RuntimeException>
+{
+   public static Test suite()
+   {
+      return suite(EnumConstantUnconvertableUnitTestCase.class);
+   }
+   
+   public EnumConstantUnconvertableUnitTestCase(String name)
+   {
+      super(name, EnumConstantUnconvertable.class, RuntimeException.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,79 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumGlobalType;
+import org.jboss.util.Strings;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * EnumGlobalTypeUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EnumGlobalTypeUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(EnumGlobalTypeUnitTestCase.class);
+   }
+   
+   public EnumGlobalTypeUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testGlobalEnumUnmarshal() throws Exception
+   {
+      unmarshalObject(EnumGlobalType.class);
+   }
+
+   public void testGlobalEnumTypeBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(EnumGlobalType.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the global type
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "enum-global-type");
+      TypeBinding type = schemaBinding.getType(qName);
+      assertNotNull(type);
+      assertEquals(qName, type.getQName());
+      
+      ElementBinding elementBinding = schemaBinding.getElement(qName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      assertNotNull(typeBinding);
+      System.out.println(Strings.defaultToString(type));
+      System.out.println(Strings.defaultToString(typeBinding));
+      assertTrue(type == typeBinding);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.AbstractErrorTest;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumNotSimple;
+
+/**
+ * EnumNotSimpleUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EnumNotSimpleUnitTestCase extends AbstractErrorTest<RuntimeException>
+{
+   public static Test suite()
+   {
+      return suite(EnumNotSimpleUnitTestCase.class);
+   }
+   
+   public EnumNotSimpleUnitTestCase(String name)
+   {
+      super(name, EnumNotSimple.class, RuntimeException.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,92 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.nondefaults.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.EnumValueAdapter;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(Root.class);
+   }
+
+   public void testNonDefaultsTypeBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Root.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the type
+      QName qName = new QName("testNamespace", "nondefaults");
+      TypeBinding type = schemaBinding.getType(qName);
+      assertNull(type);
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, "root");
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      
+      ValueAdapter valueAdapter = typeBinding.getValueAdapter();
+      assertNotNull(valueAdapter);
+      assertTrue(valueAdapter instanceof EnumValueAdapter);
+      EnumValueAdapter enumValueAdapter = (EnumValueAdapter) valueAdapter;
+
+      HashMap<Object, Object> expected = new HashMap<Object, Object>();
+      expected.put(new Integer(1), Root.ONE);
+      expected.put(new Integer(2), Root.TWO);
+      expected.put(new Integer(3), Root.THREE);
+
+      Map<Object, Object> actual = enumValueAdapter.getMapping();
+      assertEquals(expected, actual);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.xmlenum.support.none.Root;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest<Root>
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/ObjectTypeXmlTransientTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/ObjectTypeXmlTransientTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/ObjectTypeXmlTransientTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltransient;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.xmltransient.test.XmlTransientInheritanceUnitTestCase;
+
+/**
+ * ObjectTypeXmlTransientTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeXmlTransientTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type XmlTransient Tests");
+
+      suite.addTest(XmlTransientInheritanceUnitTestCase.suite());
+      // TODO more tests
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/ObjectTypeXmlTransientTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Bean.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Bean.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Bean.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltransient.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Bean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bean
+{
+   private String className;
+   
+   private Object instance;
+   
+   public String getClassName()
+   {
+      return className;
+   }
+   
+   @XmlAttribute
+   public void setClassName(String className)
+   {
+      this.className = className;
+   }
+   
+   public Object getBean() throws Exception
+   {
+      if (instance == null)
+         instance = initialize();
+      return instance;
+   }
+   
+   protected Object initialize() throws Exception
+   {
+      Class<?> clazz = Class.forName(className);
+      return clazz.newInstance();
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Factory.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Factory.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/Factory.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,80 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltransient.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * Factory.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Factory extends Bean
+{
+   private String beanClassName;
+
+   public Factory()
+   {
+      super.setClassName(FactoryBean.class.getName());
+   }
+
+   /* Uncommenting this makes no difference 
+   public String getClassName()
+   {
+      return super.getClassName();
+   } */
+   
+   @XmlTransient
+   @Override
+   public void setClassName(String className)
+   {
+      throw new RuntimeException("This method is marked @XmlTransient why is it being invoked by JAXB?");
+   }
+   
+   public String getBeanClassName()
+   {
+      return beanClassName;
+   }
+   
+   @XmlAttribute(name="className")
+   public void setBeanClassName(String beanClassName)
+   {
+      this.beanClassName = beanClassName;
+   }
+
+   @Override   
+   public Object getBean() throws Exception
+   {
+      FactoryBean factoryBean = (FactoryBean) super.getBean();
+      return factoryBean.create();
+   }
+   
+   @Override
+   protected Object initialize() throws Exception
+   {
+      FactoryBean factoryBean = (FactoryBean) super.initialize();
+      factoryBean.setClassName(beanClassName);
+      return factoryBean;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/FactoryBean.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/FactoryBean.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/support/FactoryBean.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltransient.support;
+
+/**
+ * FactoryBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class FactoryBean
+{
+   private String className;
+   
+   public String getClassName()
+   {
+      return className;
+   }
+   
+   public void setClassName(String className)
+   {
+      this.className = className;
+   }
+   
+   public Object create() throws Exception
+   {
+      Class<?> clazz = Class.forName(className);
+      return clazz.newInstance();
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritanceUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritanceUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritanceUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltransient.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmltransient.support.Factory;
+import org.jboss.test.xb.builder.object.type.xmltransient.support.FactoryBean;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AllUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlTransientInheritanceUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(XmlTransientInheritanceUnitTestCase.class);
+   }
+   
+   public XmlTransientInheritanceUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshal() throws Exception
+   {
+      Factory factory = unmarshalObject(Factory.class);
+
+      assertEquals(FactoryBean.class.getName(), factory.getClassName());
+      assertEquals(Object.class.getName(), factory.getBeanClassName());
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Factory.class);
+      assertNotNull(schemaBinding);
+      
+      // TODO check the model
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/ObjectTypeXmlTypeTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/ObjectTypeXmlTypeTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/ObjectTypeXmlTypeTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.xb.builder.object.type.xmltype.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmltype.test.NonDefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.type.xmltype.test.NoneUnitTestCase;
+
+/**
+ * ObjectTypeXmlTypeTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectTypeXmlTypeTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object Type XmlType Tests");
+
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+
+      // TODO test semantics
+      
+      return suite;
+   }
+}


Property changes on: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/ObjectTypeXmlTypeTestSuite.java
___________________________________________________________________
Name: svn:executable
   + 

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/defaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/defaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/defaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.support.defaults;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/nondefaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/nondefaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/nondefaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.support.nondefaults;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(namespace="testNamespace", name="nondefaults")
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/none/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/none/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/support/none/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.support.none;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.BeanHandler;
+
+/**
+ * AbstractErrorTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+   
+   /** Whether this is  a root type */
+   private boolean rootType;
+   
+   public AbstractDefaultsTest(String name, Class<?> root, boolean rootType)
+   {
+      super(name);
+      this.root = root;
+      this.rootType = rootType;
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(root);
+   }
+
+   public void testDefaultsTypeBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the type
+      QName qName = new QName(XMLConstants.NULL_NS_URI, "root");
+      QName elementName = qName;
+      TypeBinding type = schemaBinding.getType(qName);
+      if (rootType)
+      {
+         assertNotNull(type);
+         assertEquals(qName, type.getQName());
+      }
+      else
+         assertNull(type);
+      
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      if (rootType)
+         assertTrue(type == typeBinding);
+      
+      ParticleHandler particleHandler = typeBinding.getHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof BeanHandler);
+      BeanHandler beanInfoElementHandler = (BeanHandler) particleHandler;
+      assertEquals(root.getName(), beanInfoElementHandler.getBeanInfo().getName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.xmltype.support.defaults.Root;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Root.class, true);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.test;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmltype.support.nondefaults.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.builder.runtime.BeanHandler;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(Root.class);
+   }
+
+   public void testNonDefaultsTypeBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Root.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the type
+      QName qName = new QName("testNamespace", "nondefaults");
+      TypeBinding type = schemaBinding.getType(qName);
+      assertNotNull(type);
+      assertEquals(qName, type.getQName());
+      
+      QName elementName = new QName(XMLConstants.NULL_NS_URI, "root");
+      ElementBinding elementBinding = schemaBinding.getElement(elementName);
+      assertNotNull(elementBinding);
+      TypeBinding typeBinding = elementBinding.getType();
+      assertTrue(type == typeBinding);
+      
+      ParticleHandler particleHandler = typeBinding.getHandler();
+      assertNotNull(particleHandler);
+      assertTrue(particleHandler instanceof BeanHandler);
+      BeanHandler beanInfoElementHandler = (BeanHandler) particleHandler;
+      assertEquals(Root.class.getName(), beanInfoElementHandler.getBeanInfo().getName());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/type/xmltype/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.type.xmltype.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.type.xmltype.support.none.Root;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, Root.class, false);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/ObjectXmlSchemaTestSuite.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/ObjectXmlSchemaTestSuite.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/ObjectXmlSchemaTestSuite.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema;
+
+import org.jboss.test.xb.builder.object.xmlschema.test.DefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.xmlschema.test.NoPkgUnitTestCase;
+import org.jboss.test.xb.builder.object.xmlschema.test.NonDefaultsUnitTestCase;
+import org.jboss.test.xb.builder.object.xmlschema.test.NoneUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * ObjectJBossXMLSchemaTestSuite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectXmlSchemaTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Object XmlSchema Tests");
+
+      suite.addTest(NoPkgUnitTestCase.suite());
+      suite.addTest(NoneUnitTestCase.suite());
+      suite.addTest(DefaultsUnitTestCase.suite());
+      suite.addTest(NonDefaultsUnitTestCase.suite());
+
+      // TODO test semantics
+      
+      return suite;
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.support.defaults;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/package-info.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/package-info.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/defaults/package-info.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,25 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+ at XmlSchema
+package org.jboss.test.xb.builder.object.xmlschema.support.defaults;
+
+import javax.xml.bind.annotation.XmlSchema;

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.support.nondefaults;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/package-info.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/package-info.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nondefaults/package-info.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,27 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+ at XmlSchema(attributeFormDefault=XmlNsForm.QUALIFIED, elementFormDefault=XmlNsForm.QUALIFIED, namespace="testNamespace", xmlns=@XmlNs(namespaceURI="testNamespace", prefix="testPrefix"))
+package org.jboss.test.xb.builder.object.xmlschema.support.nondefaults;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.support.none;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/package-info.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/package-info.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/none/package-info.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,22 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.support.none;

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nopkg/Root.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nopkg/Root.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/support/nopkg/Root.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.support.nopkg;
+
+/**
+ * EnumGlobalType
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Root
+{
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/AbstractDefaultsTest.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/AbstractDefaultsTest.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/AbstractDefaultsTest.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.test;
+
+import java.util.Collections;
+
+import javax.xml.XMLConstants;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * AbstractErrorTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDefaultsTest extends AbstractBuilderTest
+{
+   /** The root class */
+   private Class<?> root;
+   
+   public AbstractDefaultsTest(String name, Class<?> root)
+   {
+      super(name);
+      this.root = root;
+   }
+
+   public void testDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(root);
+   }
+
+   public void testDefaultsSchemaBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(root);
+      testDefaults(schemaBinding);
+   }
+   
+   protected void testDefaults(SchemaBinding schemaBinding)
+   {
+      assertNotNull(schemaBinding);
+      
+      // Check the annotation values
+      assertEquals(Collections.singleton(XMLConstants.NULL_NS_URI), schemaBinding.getNamespaces());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/DefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/DefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/DefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.xmlschema.support.defaults.Root;
+
+/**
+ * DefaultsTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultsUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(DefaultsUnitTestCase.class);
+   }
+   
+   public DefaultsUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoPkgUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoPkgUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoPkgUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.test;
+
+import org.jboss.test.xb.builder.object.xmlschema.support.nopkg.Root;
+
+import junit.framework.Test;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoPkgUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(NoPkgUnitTestCase.class);
+   }
+   
+   public NoPkgUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaultsUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaultsUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaultsUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.test;
+
+import java.util.Collections;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.xmlschema.support.nondefaults.Root;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * NonDefaultsUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonDefaultsUnitTestCase extends AbstractBuilderTest
+{
+   public static Test suite()
+   {
+      return suite(NonDefaultsUnitTestCase.class);
+   }
+   
+   public NonDefaultsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testNonDefaultsUnmarshal() throws Exception
+   {
+      unmarshalObject(Root.class);
+   }
+
+   public void testNonDefaultsSchemaBinding() throws Exception
+   {
+      SchemaBinding schemaBinding = JBossXBBuilder.build(Root.class);
+      assertNotNull(schemaBinding);
+      
+      // Check the annotation values
+      assertEquals(Collections.singleton("testNamespace"), schemaBinding.getNamespaces());
+   }
+}

Added: jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoneUnitTestCase.java
===================================================================
--- jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoneUnitTestCase.java	                        (rev 0)
+++ jbossxb-builder/src/test/java/org/jboss/test/xb/builder/object/xmlschema/test/NoneUnitTestCase.java	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xb.builder.object.xmlschema.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.xb.builder.object.xmlschema.support.none.Root;
+
+/**
+ * NoneUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoneUnitTestCase extends AbstractDefaultsTest
+{
+   public static Test suite()
+   {
+      return suite(NoneUnitTestCase.class);
+   }
+   
+   public NoneUnitTestCase(String name)
+   {
+      super(name, Root.class);
+   }
+}

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/Integer.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/Integer.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/Integer.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<integer-attribute attribute="4"/>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/String.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/String.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/attribute/test/String.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<string-attribute attribute="hello"/>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root><element>Hello</element></root>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root><local xmlns="testNamespace">Hello</local></root>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlelement/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root><element>Hello</element></root>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<nondefaults xmlns="testNamespace"/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/element/xmlrootelement/specified/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<defaults/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<non-defaults xmlns="testNamespace"/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/jbossxmlschema/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<none/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/All.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/All.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/All.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<all>
+  <three>three</three>
+  <one>one</one>
+  <two>two</two>
+</all>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Alpha.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Alpha.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Alpha.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<alpha>
+  <one>one</one>
+  <three>three</three>
+  <two>two</two>
+</alpha>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Sequence.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Sequence.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/accessor/test/Sequence.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<sequence>
+  <three>three</three>
+  <two>two</two>
+  <one>one</one>
+</sequence>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/Array.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/Array.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/Array.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-array>
+   <array>ONE</array>
+   <array>TWO</array>
+   <array>THREE</array>
+</root-array>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/ArrayList.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/ArrayList.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/ArrayList.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-array-list>
+   <collection>ONE</collection>
+   <collection>TWO</collection>
+   <collection>THREE</collection>
+</root-array-list>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/HashSet.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/HashSet.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/collection/test/HashSet.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-hash-set>
+   <collection>ONE</collection>
+   <collection>TWO</collection>
+   <collection>THREE</collection>
+</root-hash-set>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/Integer.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/Integer.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/Integer.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<integer>4</integer>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/String.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/String.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/simple/test/String.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<string>hello</string>

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/Integer.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/Integer.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/Integer.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<integer-value>4</integer-value>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValue.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValue.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/NotSpecifiedValue.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<string-value>Hello</string-value>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValue.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValue.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/SpecifiedValue.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<specified-value>Hello</specified-value>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/String.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/String.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/value/test/String.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<string-value>Hello</string-value>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayElementWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<array-element-wildcard>
+   <test-element-1/>
+   <test-element-2/>
+</array-element-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ArrayObjectWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<array-object-wildcard>
+   <simple-java-bean xmlns="urn:SimpleJavaBean"/>
+   <another-java-bean xmlns="urn:AnotherJavaBean"/>
+</array-object-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ElementWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<element-wildcard>
+   <test-element/>
+</element-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListElementWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<list-element-wildcard>
+   <test-element-1/>
+   <test-element-2/>
+</list-element-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/ListObjectWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<list-object-wildcard>
+   <simple-java-bean xmlns="urn:SimpleJavaBean"/>
+   <another-java-bean xmlns="urn:AnotherJavaBean"/>
+</list-object-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcard.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcard.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlanyelement/test/SimpleObjectWildcard.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<simple-object-wildcard>
+   <simple-java-bean xmlns="urn:SimpleJavaBean"/>
+</simple-object-wildcard>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>ONE</root>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertable.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertable.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertable.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<enum-constant-unconvertable>ONE</enum-constant-unconvertable>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalType.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalType.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalType.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<enum-global-type>ONE</enum-global-type>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimple.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimple.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimple.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<enum-not-simple>ONE</enum-not-simple>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>1</root>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>ONE</root>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritance.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritance.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltransient/test/XmlTransientInheritance.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<factory className="java.lang.Object"/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/type/xmltype/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/Defaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/Defaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/Defaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NoPkg.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NoPkg.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NoPkg.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaults.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaults.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/NonDefaults.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root xmlns="testNamespace"/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/None.xml
===================================================================
--- jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/None.xml	                        (rev 0)
+++ jbossxb-builder/src/test/resources/org/jboss/test/xb/builder/object/xmlschema/test/None.xml	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root/>
\ No newline at end of file

Added: jbossxb-builder/src/test/resources/xml.xsd
===================================================================
--- jbossxb-builder/src/test/resources/xml.xsd	                        (rev 0)
+++ jbossxb-builder/src/test/resources/xml.xsd	2007-02-08 12:41:49 UTC (rev 2269)
@@ -0,0 +1,86 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+  
+  <xs:annotation>
+    <xs:documentation> See http://www.w3.org/XML/1998/namespace.html and http://www.w3.org/TR/REC-xml for information about this namespace. This schema document describes the XML
+      namespace, in a form suitable for import by other schema documents. Note that local names in this namespace are intended to be defined only by the World Wide Web Consortium or its subgroups. The
+      following names are currently defined in this namespace and should not be used with conflicting semantics by any Working Group, specification, or document instance: base (as an attribute
+      name): denotes an attribute whose value provides a URI to be used as the base for interpreting any relative URIs in the scope of the element on which it appears; its value is inherited. This name is
+      reserved by virtue of its definition in the XML Base specification. id (as an attribute name): denotes an attribute whose value should be interpreted as if declared to be of type ID. The xml:id
+      specification is not yet a W3C Recommendation, but this attribute is included here to facilitate experimentation with the mechanisms it proposes. Note that it is _not_ included in the
+      specialAttrs attribute group. lang (as an attribute name): denotes an attribute whose value is a language code for the natural language of the content of any element; its value is inherited.
+      This name is reserved by virtue of its definition in the XML specification. space (as an attribute name): denotes an attribute whose value is a keyword indicating what whitespace processing
+      discipline is intended for the content of the element; its value is inherited. This name is reserved by virtue of its definition in the XML specification. Father (in any context at all): denotes
+      Jon Bosak, the chair of the original XML Working Group. This name is reserved by the following decision of the W3C XML Plenary and XML Coordination groups: In appreciation for his vision,
+      leadership and dedication the W3C XML Plenary on this 10th day of February, 2000 reserves for Jon Bosak in perpetuity the XML name xml:Father </xs:documentation>
+  </xs:annotation>
+  
+  <xs:annotation>
+    <xs:documentation>This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang, xml:space or xml:id attributes on elements they
+      define. To enable this, such a schema must import this schema for the XML namespace, e.g. as follows:
+      &lt;schema . . .> . . .
+      &lt;import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> Subsequently, qualified reference to any of the attributes or
+      the group defined below will have the desired effect, e.g.
+      
+      &lt;type . . .> . . .
+      &lt;attributeGroup ref="xml:specialAttrs"/> will define a type which will schema-validate an instance element with any of those attributes</xs:documentation>
+    
+  </xs:annotation>
+  
+  <xs:annotation>
+    <xs:documentation>In keeping with the XML Schema WG's standard versioning policy, this schema document will persist at http://www.w3.org/2005/08/xml.xsd. At the date of issue it can also be
+      found at http://www.w3.org/2001/xml.xsd. The schema document at that URI may however change in the future, in order to remain compatible with the latest version of XML Schema itself, or with
+      the XML namespace itself. In other words, if the XML Schema or XML namespaces change, the version of this document at http://www.w3.org/2001/xml.xsd will change accordingly; the version at
+      http://www.w3.org/2005/08/xml.xsd will not change. </xs:documentation>
+  </xs:annotation>
+  
+  <xs:attribute name="lang">
+    <xs:annotation>
+      <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter codes as the enumerated possible values is probably never going to be a realistic possibility. See RFC 3066 at
+        http://www.ietf.org/rfc/rfc3066.txt and the IANA registry at http://www.iana.org/assignments/lang-tag-apps.htm for further information. The union allows for the
+        'un-declaration' of xml:lang with the empty string.</xs:documentation>
+      
+    </xs:annotation>
+    <xs:simpleType>
+      <xs:union memberTypes="xs:language">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value=""/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:union>
+      
+    </xs:simpleType>
+  </xs:attribute>
+  
+  <xs:attribute name="space">
+    <xs:simpleType>
+      <xs:restriction base="xs:NCName">
+        <xs:enumeration value="default"/>
+        <xs:enumeration value="preserve"/>
+      </xs:restriction>
+      
+    </xs:simpleType>
+  </xs:attribute>
+  
+  <xs:attribute name="base" type="xs:anyURI">
+    <xs:annotation>
+      <xs:documentation>See http://www.w3.org/TR/xmlbase/ for information about this attribute.</xs:documentation>
+    </xs:annotation>
+  </xs:attribute>
+  
+  <xs:attribute name="id" type="xs:ID">
+    
+    <xs:annotation>
+      <xs:documentation>See http://www.w3.org/TR/xml-id/ for information about this attribute.</xs:documentation>
+    </xs:annotation>
+  </xs:attribute>
+  
+  <xs:attributeGroup name="specialAttrs">
+    <xs:attribute ref="xml:base"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute ref="xml:space"/>
+    
+  </xs:attributeGroup>
+  
+</xs:schema>
\ No newline at end of file


Property changes on: jbossxb-builder/src/test/resources/xml.xsd
___________________________________________________________________
Name: svn:executable
   + 




More information about the jboss-svn-commits mailing list