[jboss-svn-commits] JBoss Common SVN: r3114 - in jbossxb/trunk/src: main/java/org/jboss/xb/builder and 15 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Apr 16 05:50:50 EDT 2009


Author: alex.loubyansky at jboss.com
Date: 2009-04-16 05:50:50 -0400 (Thu, 16 Apr 2009)
New Revision: 3114

Added:
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/AbstractSystemPropertyInitializationTest.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/BasicSequence.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithSequenceProperty.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUndefinedPropOrder.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequence.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequenceProperty.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithXmlAccessorOrder.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/SequenceType.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/UnorderedSequenceType.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/AbstractSequencesRequirePropOrderTest.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/InitializationUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithSequencePropertyUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUndefinedPropOrderUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequencePropertyUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequenceUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithXmlAccessorOrderUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithSequencePropertyUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithUndefinedPropOrderUnitTestCase.java
Modified:
   jbossxb/trunk/src/main/java/org/jboss/javabean/plugins/jaxb/JavaBean20.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/javabean/support/model/JavaBean.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlmapentry/support/Root.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringFalse.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringTrue.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCallbackMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractFeatureMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractValueMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/Cardinality.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/InstallCallbackMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/UninstallCallbackMetaData.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/support/RootWithTwoParticleGroups.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmltype/test/JBossXmlTypeUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/FailIgnoreCaseTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/useunorderedsequence/test/InitializationUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xml/ListValueUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xml/unorderedsequence/test/UnorderedSequenceAnnotationUnitTestCase.java
Log:
JBXB-198

Modified: jbossxb/trunk/src/main/java/org/jboss/javabean/plugins/jaxb/JavaBean20.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/javabean/plugins/jaxb/JavaBean20.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/main/java/org/jboss/javabean/plugins/jaxb/JavaBean20.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -37,7 +37,7 @@
  */
 @JBossXmlSchema(namespace="urn:jboss:javabean:2.0", elementFormDefault=XmlNsForm.QUALIFIED)
 @XmlRootElement(name="javabean")
- at XmlType(name="javabeanType")
+ at XmlType(name="javabeanType", propOrder={"constructor", "properties"})
 @JBossXmlType(beanAdapterBuilder=JavaBeanBuilder20.class)
 public class JavaBean20 extends JavaBean
 {

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -59,7 +59,10 @@
 {
    /** system property name to use for initialization */
    public static final String USE_UNORDERED_SEQUENCE_PROPERTY = "xb.builder.useUnorderedSequence";
-   
+
+   /** system property name to use for initialization */
+   public static final String SEQUENCES_REQUIRE_PROP_ORDER = "xb.builder.sequencesRequirePropOrder";
+
    /** The configuration */
    static Configuration configuration;
    
@@ -70,7 +73,9 @@
    static final ClassInfo OBJECT;
    
    static boolean useUnorderedSequence;
-   
+
+   static boolean sequencesRequirePropOrder;
+
    static
    {
       configuration = AccessController.doPrivileged(new PrivilegedAction<PropertyConfiguration>()
@@ -95,6 +100,20 @@
       );            
       if(useUnorderedSequenceStr != null)
          useUnorderedSequence = Boolean.parseBoolean(useUnorderedSequenceStr);
+      
+      String sequencesRequirePropOrderStr = AccessController.doPrivileged(
+            new PrivilegedAction<String>()
+            {
+               public String run()
+               {
+                  return System.getProperty(JBossXBBuilder.SEQUENCES_REQUIRE_PROP_ORDER);
+               }               
+            }
+      ); 
+      if(sequencesRequirePropOrderStr != null)
+         sequencesRequirePropOrder = Boolean.parseBoolean(sequencesRequirePropOrderStr);
+      else
+         sequencesRequirePropOrder = true;
    }
    
    public static boolean isUseUnorderedSequence()
@@ -107,6 +126,16 @@
       JBossXBBuilder.useUnorderedSequence = unorderedSequences;
    }
 
+   public static boolean isSequencesRequirePropOrder()
+   {
+      return sequencesRequirePropOrder;
+   }
+   
+   public static void setSequencesRequirePropOrder(boolean sequencesRequirePropOrder)
+   {
+      JBossXBBuilder.sequencesRequirePropOrder = sequencesRequirePropOrder;
+   }
+   
    /**
     * Create a new schema binding initializer
     * 
@@ -223,6 +252,7 @@
       
       JBossXBNoSchemaBuilder builder = new JBossXBNoSchemaBuilder(classInfo);
       builder.setUseUnorderedSequence(useUnorderedSequence);
+      builder.setSequencesRequirePropOrder(sequencesRequirePropOrder);
       builder.build(schemaBinding);
    }
    
@@ -257,6 +287,7 @@
       {
          JBossXBNoSchemaBuilder builder = new JBossXBNoSchemaBuilder(classInfo);
          builder.setUseUnorderedSequence(useUnorderedSequence);
+         builder.setSequencesRequirePropOrder(sequencesRequirePropOrder);
          binding = builder.build();
          classInfo.setAttachment(SchemaBinding.class.getName(), binding);
       }

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -178,6 +178,7 @@
    private ModelGroupFactory groupFactory = DefaultModelGroupFactory.INSTANCE;
    
    private boolean useUnorderedSequence;
+   private boolean sequencesRequirePropOrder;
    
    /**
     * Create a new JBossXBNoSchemaBuilder.
@@ -207,6 +208,16 @@
          groupFactory = DefaultModelGroupFactory.INSTANCE;
    }
    
+   public boolean isSequenceRequirePropOrder()
+   {
+      return sequencesRequirePropOrder;
+   }
+   
+   public void setSequencesRequirePropOrder(boolean sequencesRequirePropOrder)
+   {
+      this.sequencesRequirePropOrder = sequencesRequirePropOrder;
+   }
+   
    /**
     * Build the schema
     * 
@@ -1049,12 +1060,17 @@
       // TODO simple types/content when no properties other than @XmlValue and @XmlAttribute
       typeBinding.setSimple(false);
       ModelGroupBinding model = null;
+      boolean propOrderMissing = propertyNames.size() > 1 && determinePropertyOrder && accessOrder == XmlAccessOrder.UNDEFINED;
       if(jbossXmlType != null && !JBossXmlConstants.DEFAULT.equals(jbossXmlType.modelGroup()))
-         model = createModelGroup(jbossXmlType.modelGroup());
+         model = createModelGroup(jbossXmlType.modelGroup(), typeInfo, propOrderMissing, propertyOrder);
       else if (allBinding)
          model = new AllBinding(schemaBinding);
       else
+      {
+         if(propOrderMissing)
+            assertPropOrderNotRequired(typeInfo, propertyOrder);
          model = groupFactory.createSequence(schemaBinding);
+      }
       
       if (trace)
          log.trace(model.getGroupType() + " model group for type=" + beanInfo.getName());
@@ -1245,6 +1261,25 @@
       return typeBinding;
    }
 
+   private void assertPropOrderNotRequired(TypeInfo typeInfo, String[] propertyOrder)
+   {
+      StringBuffer msg = new StringBuffer();
+      msg.append("Property order is not specified for type ")
+      .append(typeInfo.getName())
+      .append(" bound to a sequence. Property order can be specified using @XmlType.propOrder or @XmlAccessorOrder.");
+      if(propertyOrder != null && propertyOrder.length > 1)
+      {
+         msg.append(" List of properties:");
+         for(String name : propertyOrder)
+            msg.append(" ").append(name);
+      }
+      
+      if(sequencesRequirePropOrder && !useUnorderedSequence)
+         throw new JBossXBRuntimeException(msg.toString());
+      else
+         log.warn(msg.toString());
+   }
+
    private void bindProperty(PropertyInfo property, ModelGroupBinding parentModel,
          BeanAdapterFactory beanAdapterFactory, String[] propertyOrder, boolean wildcardProperty)
    {
@@ -1716,10 +1751,15 @@
          if(group != null)
             createGroup = false;
       }
-      
+
+      TypeInfo groupType = property.getType();
+      if(groupType.isCollection())
+         groupType = ((ClassInfo)groupType).getComponentType();
+
       if(createGroup)
       {
-         group = createModelGroup(annotation.kind());
+         boolean propOrderMissing = annotation.propOrder().length == 1 && annotation.propOrder()[0].equals("") || annotation.particles().length > 0;
+         group = createModelGroup(annotation.kind(), groupType, propOrderMissing, annotation.propOrder());
          if (groupName != null)
          {
             group.setQName(groupName);
@@ -1729,10 +1769,6 @@
       
       parentGroup.addParticle(new ParticleBinding(group, 0, 1, property.getType().isCollection()));
 
-      TypeInfo groupType = property.getType();
-      if(groupType.isCollection())
-         groupType = ((ClassInfo)groupType).getComponentType();
-
       if(annotation.particles().length == 0)
       {
          if(createGroup)
@@ -1810,11 +1846,15 @@
       defaultNamespace = overridenDefaultNamespace;
    }
 
-   private ModelGroupBinding createModelGroup(String kind)
+   private ModelGroupBinding createModelGroup(String kind, TypeInfo type, boolean propOrderMissing, String[] propertyOrder)
    {
       ModelGroupBinding group;
       if (kind.equals(JBossXmlConstants.MODEL_GROUP_SEQUENCE))
+      {
+         if(propOrderMissing)
+            assertPropOrderNotRequired(type, propertyOrder);
          group = groupFactory.createSequence(schemaBinding);
+      }
       else if (kind.equals(JBossXmlConstants.MODEL_GROUP_UNORDERED_SEQUENCE))
          group = new UnorderedSequenceBinding(schemaBinding);
       else if (kind.equals(JBossXmlConstants.MODEL_GROUP_CHOICE))
@@ -1822,7 +1862,7 @@
       else if (kind.equals(JBossXmlConstants.MODEL_GROUP_ALL))
          group = new AllBinding(schemaBinding);
       else
-         throw new IllegalStateException("Unexpected JBossXmlModelGroup.kind=" + kind);
+         throw new IllegalStateException("Unexpected JBossXmlModelGroup.kind=" + kind + " for type " + type.getName());
       return group;
    }
       
@@ -1976,7 +2016,7 @@
          if (locations.isEmpty() == false)
             message.append('\n');
       }
-      throw new RuntimeException(message.toString(), t);
+      throw new JBossXBRuntimeException(message.toString(), t);
    }
 
    /** A location */

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/AbstractSystemPropertyInitializationTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/AbstractSystemPropertyInitializationTest.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/AbstractSystemPropertyInitializationTest.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.URLClassLoader;
+
+import org.jboss.xb.builder.JBossXBBuilder;
+
+import junit.framework.TestCase;
+
+public abstract class AbstractSystemPropertyInitializationTest extends TestCase
+{
+
+   private String defaultSystemValue;
+   private ClassLoader cl;
+
+   public AbstractSystemPropertyInitializationTest()
+   {
+      super();
+   }
+
+   public AbstractSystemPropertyInitializationTest(String name)
+   {
+      super(name);
+   }
+
+   protected abstract String getPropertyName();
+   protected abstract String getPropertyGetter();
+   
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      defaultSystemValue = System.getProperty(getPropertyName());
+      
+      ClassLoader builderCl = JBossXBBuilder.class.getClassLoader();
+      if(builderCl == null)
+         builderCl = ClassLoader.getSystemClassLoader();      
+      assertTrue(builderCl instanceof URLClassLoader);
+      cl = new URLClassLoader(((URLClassLoader)builderCl).getURLs(), null);
+   }
+
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+      if(defaultSystemValue != null)
+         System.setProperty(getPropertyName(), defaultSystemValue);
+   }
+
+   public void testFalse() throws Exception
+   {
+      initAndAssert(false);
+   }
+
+   public void testTrue() throws Exception
+   {
+      initAndAssert(true);
+   }
+
+   private void initAndAssert(Boolean value) throws Exception
+   {
+      System.setProperty(getPropertyName(), Boolean.toString(value));
+      Class<?> clazz = cl.loadClass(JBossXBBuilder.class.getName());
+      Method m = clazz.getMethod(getPropertyGetter());
+      assertEquals(value, m.invoke(null));
+   }
+
+}
\ No newline at end of file

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/javabean/support/model/JavaBean.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/javabean/support/model/JavaBean.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/javabean/support/model/JavaBean.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -49,7 +49,7 @@
  */
 @JBossXmlSchema(namespace="test:javabean", elementFormDefault=XmlNsForm.QUALIFIED)
 @XmlRootElement(name="javabean")
- at XmlType(name="javabean")
+ at XmlType(name="javabean", propOrder={"constructor", "properties"})
 @JBossXmlType(beanAdapterBuilder=JavaBeanBuilder.class)
 public class JavaBean extends BeanAdapter
 {

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -27,6 +27,8 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.jboss.xb.annotations.JBossXmlCollection;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlType;
 
 
 /**
@@ -36,6 +38,7 @@
  * @version $Revision: 1.1 $
  */
 @XmlRootElement
+ at JBossXmlType(modelGroup=JBossXmlConstants.MODEL_GROUP_CHOICE)
 public class Root
 {
    private List<String> defaultList;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlmapentry/support/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlmapentry/support/Root.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlmapentry/support/Root.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -28,12 +28,14 @@
 import javax.xml.bind.annotation.XmlNsForm;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.jboss.xb.annotations.JBossXmlConstants;
 import org.jboss.xb.annotations.JBossXmlMapEntry;
 import org.jboss.xb.annotations.JBossXmlMapKeyAttribute;
 import org.jboss.xb.annotations.JBossXmlMapKeyElement;
 import org.jboss.xb.annotations.JBossXmlMapValueAttribute;
 import org.jboss.xb.annotations.JBossXmlMapValueElement;
 import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.annotations.JBossXmlType;
 
 
 /**
@@ -44,6 +46,7 @@
  */
 @XmlRootElement
 @JBossXmlSchema(namespace="ns", elementFormDefault= XmlNsForm.QUALIFIED)
+ at JBossXmlType(modelGroup=JBossXmlConstants.MODEL_GROUP_CHOICE)
 public class Root
 {
    private Map<String, Integer> stringToInteger;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringFalse.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringFalse.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringFalse.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
 
 import org.jboss.xb.annotations.JBossXmlValue;
 
@@ -35,6 +36,7 @@
  */
 @XmlRootElement(name="root")
 @JBossXmlValue(ignoreEmptyString=false)
+ at XmlType(propOrder={"child", "children"})
 public class MixedTypeIgnoreEmptyStringFalse extends MixedType
 {
    private List<MixedTypeIgnoreEmptyStringFalse> children;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringTrue.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringTrue.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlvalue/support/MixedTypeIgnoreEmptyStringTrue.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -25,6 +25,7 @@
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
 
 import org.jboss.xb.annotations.JBossXmlValue;
 
@@ -36,6 +37,7 @@
  */
 @XmlRootElement(name="root")
 @JBossXmlValue(ignoreEmptyString=true)
+ at XmlType(propOrder={"child", "children"})
 public class MixedTypeIgnoreEmptyStringTrue extends MixedType
 {
    private List<MixedTypeIgnoreEmptyStringTrue> children;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCallbackMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCallbackMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCallbackMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -24,6 +24,7 @@
 import java.io.Serializable;
 
 import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
 
 import org.jboss.util.JBossStringBuilder;
 
@@ -91,6 +92,7 @@
       flushJBossObjectCache();
    }
 
+   @XmlTransient
    public ControllerState getWhenRequiredState()
    {
       return whenRequired;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractFeatureMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractFeatureMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractFeatureMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -25,6 +25,7 @@
 import java.util.Set;
 
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
 
 import org.jboss.util.JBossObject;
 import org.jboss.util.JBossStringBuilder;
@@ -53,6 +54,13 @@
    {
    }
    
+   @Override
+   @XmlTransient
+   public String getClassShortName()
+   {
+      return super.getClassShortName();
+   }
+   
    /**
     * Set the description.
     * 

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -159,6 +159,7 @@
       return map.get(key);
    }
 
+   @XmlTransient
    public boolean isEmpty()
    {
       return map.isEmpty();

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractValueMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractValueMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractValueMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 
+import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
 import org.jboss.reflect.spi.TypeInfo;
@@ -65,6 +66,13 @@
       this.value = value;
    }
 
+   @Override
+   @XmlTransient
+   public String getClassShortName()
+   {
+      return super.getClassShortName();
+   }
+   
    public Object getValue()
    {
       return value;
@@ -76,6 +84,7 @@
       flushJBossObjectCache();
    }
 
+   @XmlTransient
    public Object getUnderlyingValue()
    {
       return value;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/Cardinality.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/Cardinality.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/Cardinality.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -34,7 +34,7 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
- at XmlType()
+ at XmlType(propOrder={})
 @JBossXmlAdaptedType(valueAdapter=CardinalityValueAdapter.class)
 public class Cardinality extends JBossObject implements Serializable
 {

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/InstallCallbackMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/InstallCallbackMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/InstallCallbackMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -21,14 +21,12 @@
 */
 package org.jboss.test.xb.builder.object.mc.support.model;
 
-import javax.xml.bind.annotation.XmlType;
 
 /**
  * Metadata for install callback.
  *
  * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  */
- at XmlType
 public class InstallCallbackMetaData extends AbstractCallbackMetaData
 {
    /** The serialVersionUID */

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/UninstallCallbackMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/UninstallCallbackMetaData.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/UninstallCallbackMetaData.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -21,14 +21,12 @@
 */
 package org.jboss.test.xb.builder.object.mc.support.model;
 
-import javax.xml.bind.annotation.XmlType;
 
 /**
  * Metadata for uninstall callback.
  *
  * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  */
- at XmlType
 public class UninstallCallbackMetaData extends AbstractCallbackMetaData
 {
    /** The serialVersionUID */

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/support/RootWithTwoParticleGroups.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/support/RootWithTwoParticleGroups.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/support/RootWithTwoParticleGroups.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -57,6 +57,7 @@
       this.group2 = group2;
    }
    
+   @XmlType(propOrder={"group", "e"})
    public static class GroupWrapper1
    {
       private AbstractChoice group;
@@ -82,6 +83,7 @@
       }
    }
 
+   @XmlType(propOrder={"group", "e"})
    public static class GroupWrapper2
    {
       private AbstractChoice group;

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmltype/test/JBossXmlTypeUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmltype/test/JBossXmlTypeUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmltype/test/JBossXmlTypeUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -58,18 +58,22 @@
    }
 
    private boolean defaultSequence;
+   private boolean sequencesRequirePropOrder;
    
    protected void setUp() throws Exception
    {
       super.setUp();
       defaultSequence = JBossXBBuilder.isUseUnorderedSequence();
       JBossXBBuilder.setUseUnorderedSequence(false);
+      sequencesRequirePropOrder = JBossXBBuilder.isSequencesRequirePropOrder();
+      JBossXBBuilder.setSequencesRequirePropOrder(false);
    }
    
    protected void tearDown() throws Exception 
    {
       super.tearDown();
       JBossXBBuilder.setUseUnorderedSequence(defaultSequence);
+      JBossXBBuilder.setSequencesRequirePropOrder(sequencesRequirePropOrder);
    }
    
    public void testModelGroupWithDefaults() throws Exception

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumConstantUnconvertableUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -25,6 +25,7 @@
 
 import org.jboss.test.xb.builder.object.AbstractErrorTest;
 import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumConstantUnconvertable;
+import org.jboss.xb.binding.JBossXBRuntimeException;
 
 /**
  * EnumConstantUnconvertableUnitTestCase.
@@ -32,7 +33,7 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class EnumConstantUnconvertableUnitTestCase extends AbstractErrorTest<RuntimeException>
+public class EnumConstantUnconvertableUnitTestCase extends AbstractErrorTest<JBossXBRuntimeException>
 {
    public static Test suite()
    {
@@ -41,6 +42,6 @@
    
    public EnumConstantUnconvertableUnitTestCase(String name)
    {
-      super(name, EnumConstantUnconvertable.class, RuntimeException.class);
+      super(name, EnumConstantUnconvertable.class, JBossXBRuntimeException.class);
    }
 }

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumNotSimpleUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -25,6 +25,7 @@
 
 import org.jboss.test.xb.builder.object.AbstractErrorTest;
 import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumNotSimple;
+import org.jboss.xb.binding.JBossXBRuntimeException;
 
 /**
  * EnumNotSimpleUnitTestCase.
@@ -32,7 +33,7 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class EnumNotSimpleUnitTestCase extends AbstractErrorTest<RuntimeException>
+public class EnumNotSimpleUnitTestCase extends AbstractErrorTest<JBossXBRuntimeException>
 {
    public static Test suite()
    {
@@ -41,6 +42,6 @@
    
    public EnumNotSimpleUnitTestCase(String name)
    {
-      super(name, EnumNotSimple.class, RuntimeException.class);
+      super(name, EnumNotSimple.class, JBossXBRuntimeException.class);
    }
 }

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/FailIgnoreCaseTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/FailIgnoreCaseTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/FailIgnoreCaseTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -24,17 +24,18 @@
 import junit.framework.Test;
 import org.jboss.test.xb.builder.object.AbstractErrorTest;
 import org.jboss.test.xb.builder.object.type.xmlenum.support.ignorecase.WrongKeyEnum;
+import org.jboss.xb.binding.JBossXBRuntimeException;
 
 /**
  * Fail ignore test case enum.
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class FailIgnoreCaseTestCase extends AbstractErrorTest<RuntimeException>
+public class FailIgnoreCaseTestCase extends AbstractErrorTest<JBossXBRuntimeException>
 {
    public FailIgnoreCaseTestCase(String name)
    {
-      super(name, WrongKeyEnum.class, RuntimeException.class);
+      super(name, WrongKeyEnum.class, JBossXBRuntimeException.class);
    }
 
    public static Test suite()

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/BasicSequence.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/BasicSequence.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/BasicSequence.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+/**
+ * A RootWithUnorderedSequence.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BasicSequence
+{
+
+   private String a;
+   private String b;
+
+   public BasicSequence()
+   {
+      super();
+   }
+
+   public String getA()
+   {
+      return a;
+   }
+
+   public void setA(String a)
+   {
+      this.a = a;
+   }
+
+   public String getB()
+   {
+      return b;
+   }
+
+   public void setB(String b)
+   {
+      this.b = b;
+   }
+
+}
\ No newline at end of file

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithSequenceProperty.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithSequenceProperty.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithSequenceProperty.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * A RootWithSequenceProperty.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement()
+public class RootWithSequenceProperty
+{
+   private SequenceType sequence;
+   
+   public SequenceType getSequence()
+   {
+      return sequence;
+   }
+   
+   public void setSequence(SequenceType sequence)
+   {
+      this.sequence = sequence;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUndefinedPropOrder.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUndefinedPropOrder.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUndefinedPropOrder.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * A RootWithoutPropOrder.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement(name="root")
+ at XmlType()
+public class RootWithUndefinedPropOrder extends BasicSequence
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequence.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequence.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequence.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlType;
+
+/**
+ * A RootWithUnorderedSequence.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement
+ at JBossXmlType(modelGroup=JBossXmlConstants.MODEL_GROUP_UNORDERED_SEQUENCE)
+public class RootWithUnorderedSequence extends BasicSequence
+{
+   
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequenceProperty.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequenceProperty.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithUnorderedSequenceProperty.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * A RootWithUnorderedSequenceProperty.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement()
+public class RootWithUnorderedSequenceProperty
+{
+   private UnorderedSequenceType sequence;
+   
+   public UnorderedSequenceType getSequence()
+   {
+      return sequence;
+   }
+   
+   public void setSequence(UnorderedSequenceType sequence)
+   {
+      this.sequence = sequence;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithXmlAccessorOrder.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithXmlAccessorOrder.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/RootWithXmlAccessorOrder.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import javax.xml.bind.annotation.XmlAccessOrder;
+import javax.xml.bind.annotation.XmlAccessorOrder;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * A RootWithXmlAccessorOrder.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement(name="root")
+ at XmlType()
+ at XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
+public class RootWithXmlAccessorOrder extends BasicSequence
+{
+
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/SequenceType.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/SequenceType.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/SequenceType.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+
+/**
+ * A SequenceType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlModelGroup(name="sequence", kind=JBossXmlConstants.MODEL_GROUP_SEQUENCE)
+public class SequenceType extends BasicSequence
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/UnorderedSequenceType.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/UnorderedSequenceType.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/support/UnorderedSequenceType.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.support;
+
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+
+/**
+ * A SequenceType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlModelGroup(name="sequence", kind=JBossXmlConstants.MODEL_GROUP_UNORDERED_SEQUENCE)
+public class UnorderedSequenceType extends BasicSequence
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/AbstractSequencesRequirePropOrderTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/AbstractSequencesRequirePropOrderTest.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/AbstractSequencesRequirePropOrderTest.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.xb.binding.JBossXBRuntimeException;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractSequencesRequirePropOrderTest extends TestCase
+{
+   protected abstract boolean isPropOrderProvided();
+   protected abstract Class<?> getRootType();
+   
+   protected boolean isUseUnorderedSequence()
+   {
+      return false;
+   }
+   
+   protected boolean isPropOrderConfigured()
+   {
+      return isUseUnorderedSequence() || isPropOrderProvided();
+   }
+   
+   public void testSequencesRequirePropOrderTrue() throws Exception
+   {
+      boolean defSequencesRequirePropOrder = JBossXBBuilder.isSequencesRequirePropOrder();
+      JBossXBBuilder.setSequencesRequirePropOrder(true);
+      boolean defUseUnorderedSequence = JBossXBBuilder.isUseUnorderedSequence();
+      JBossXBBuilder.setUseUnorderedSequence(isUseUnorderedSequence());
+      try
+      {
+         JBossXBBuilder.build(getRootType(), true);
+         if(!isPropOrderConfigured())
+            fail("Binding didn't fail for " + getRootType().getName());
+      }
+      catch(JBossXBRuntimeException e)
+      {
+         if(isPropOrderProvided())
+            throw e;
+      }
+      finally
+      {
+         JBossXBBuilder.setSequencesRequirePropOrder(defSequencesRequirePropOrder);
+         JBossXBBuilder.setUseUnorderedSequence(defUseUnorderedSequence);
+      }
+   }
+   
+   public void testSequencesRequirePropOrderFalse() throws Exception
+   {
+      boolean defSequencesRequirePropOrder = JBossXBBuilder.isSequencesRequirePropOrder();
+      JBossXBBuilder.setSequencesRequirePropOrder(false);
+      boolean defUseUnorderedSequence = JBossXBBuilder.isUseUnorderedSequence();
+      JBossXBBuilder.setUseUnorderedSequence(isUseUnorderedSequence());
+      try
+      {
+         JBossXBBuilder.build(getRootType(), true);
+      }
+      finally
+      {
+         JBossXBBuilder.setSequencesRequirePropOrder(defSequencesRequirePropOrder);
+         JBossXBBuilder.setUseUnorderedSequence(defUseUnorderedSequence);
+      }      
+   }
+}
\ No newline at end of file

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/InitializationUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/InitializationUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/InitializationUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+
+import org.jboss.test.xb.builder.AbstractSystemPropertyInitializationTest;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+
+/**
+ * A InitializationUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class InitializationUnitTestCase extends AbstractSystemPropertyInitializationTest
+{
+   @Override
+   protected String getPropertyGetter()
+   {
+      return "isSequencesRequirePropOrder";
+   }
+
+   @Override
+   protected String getPropertyName()
+   {
+      return JBossXBBuilder.SEQUENCES_REQUIRE_PROP_ORDER;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithSequencePropertyUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithSequencePropertyUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithSequencePropertyUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithSequenceProperty;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithSequencePropertyUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithSequenceProperty.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return false;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUndefinedPropOrderUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUndefinedPropOrderUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUndefinedPropOrderUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithUndefinedPropOrder;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithUndefinedPropOrderUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithUndefinedPropOrder.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return false;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequencePropertyUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequencePropertyUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequencePropertyUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithUnorderedSequenceProperty;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithUnorderedSequencePropertyUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithUnorderedSequenceProperty.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return true;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequenceUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequenceUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithUnorderedSequenceUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithUnorderedSequence;
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithUnorderedSequenceUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithUnorderedSequence.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return true;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithXmlAccessorOrderUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithXmlAccessorOrderUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/RootWithXmlAccessorOrderUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithXmlAccessorOrder;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithXmlAccessorOrderUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithXmlAccessorOrder.class;
+   }
+
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return true;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithSequencePropertyUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithSequencePropertyUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithSequencePropertyUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithSequenceProperty;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class UnorderedSequenceForRootWithSequencePropertyUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithSequenceProperty.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return false;
+   }
+   
+   @Override
+   protected boolean isUseUnorderedSequence()
+   {
+      return true;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithUndefinedPropOrderUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithUndefinedPropOrderUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/sequencesrequireproporder/test/UnorderedSequenceForRootWithUndefinedPropOrderUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.sequencesrequireproporder.test;
+
+import org.jboss.test.xb.builder.sequencesrequireproporder.support.RootWithUndefinedPropOrder;
+
+
+
+/**
+ * A SequencesRequirePropOrderUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class UnorderedSequenceForRootWithUndefinedPropOrderUnitTestCase extends AbstractSequencesRequirePropOrderTest
+{
+   @Override
+   protected Class<?> getRootType()
+   {
+      return RootWithUndefinedPropOrder.class;
+   }
+   
+   @Override
+   protected boolean isPropOrderProvided()
+   {
+      return false;
+   }
+   
+   @Override
+   protected boolean isUseUnorderedSequence()
+   {
+      return true;
+   }
+}

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/useunorderedsequence/test/InitializationUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/useunorderedsequence/test/InitializationUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/useunorderedsequence/test/InitializationUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -21,12 +21,10 @@
  */
 package org.jboss.test.xb.builder.useunorderedsequence.test;
 
-import java.lang.reflect.Method;
-import java.net.URLClassLoader;
 
+import org.jboss.test.xb.builder.AbstractSystemPropertyInitializationTest;
 import org.jboss.xb.builder.JBossXBBuilder;
 
-import junit.framework.TestCase;
 
 /**
  * A InitializationUnitTestCase.
@@ -34,45 +32,17 @@
  * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
  * @version $Revision: 1.1 $
  */
-public class InitializationUnitTestCase extends TestCase
+public class InitializationUnitTestCase extends AbstractSystemPropertyInitializationTest
 {
-   private String unorderedSequenceDefaultSystemValue;
-   private ClassLoader cl;
-   
-   protected void setUp() throws Exception
+   @Override
+   protected String getPropertyGetter()
    {
-      super.setUp();
-      unorderedSequenceDefaultSystemValue = System.getProperty(JBossXBBuilder.USE_UNORDERED_SEQUENCE_PROPERTY);
-      
-      ClassLoader builderCl = JBossXBBuilder.class.getClassLoader();
-      if(builderCl == null)
-         builderCl = ClassLoader.getSystemClassLoader();      
-      assertTrue(builderCl instanceof URLClassLoader);
-      cl = new URLClassLoader(((URLClassLoader)builderCl).getURLs(), null);
+      return "isUseUnorderedSequence";
    }
-   
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-      if(unorderedSequenceDefaultSystemValue != null)
-         System.setProperty(JBossXBBuilder.USE_UNORDERED_SEQUENCE_PROPERTY, unorderedSequenceDefaultSystemValue);
-   }
-   
-   public void testFalse() throws Exception
-   {
-      initAndAssert(false);
-   }
 
-   public void testTrue() throws Exception
+   @Override
+   protected String getPropertyName()
    {
-      initAndAssert(true);
+      return JBossXBBuilder.USE_UNORDERED_SEQUENCE_PROPERTY;
    }
-
-   private void initAndAssert(Boolean value) throws Exception
-   {
-      System.setProperty(JBossXBBuilder.USE_UNORDERED_SEQUENCE_PROPERTY, Boolean.toString(value));
-      Class<?> clazz = cl.loadClass(JBossXBBuilder.class.getName());
-      Method m = clazz.getMethod("isUseUnorderedSequence");
-      assertEquals(value, m.invoke(null));
-   }
 }

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/ListValueUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/ListValueUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/ListValueUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -46,8 +46,6 @@
 
    public void testCtor() throws Exception
    {
-      System.out.println(getName());
-      
       //SchemaBinding schema = JBossXBBuilder.build(Root.class);
       //Object o = unmarshal("ListValueUnitTestCase_" + getName() + ".xml", schema);
       Object o = unmarshal();

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/unorderedsequence/test/UnorderedSequenceAnnotationUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/unorderedsequence/test/UnorderedSequenceAnnotationUnitTestCase.java	2009-04-16 09:42:35 UTC (rev 3113)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/unorderedsequence/test/UnorderedSequenceAnnotationUnitTestCase.java	2009-04-16 09:50:50 UTC (rev 3114)
@@ -107,12 +107,12 @@
       }
    }
 
-   @JBossXmlModelGroup(name="defaultGroup")
+   @JBossXmlModelGroup(name="defaultGroup", propOrder={"a", "b"})
    public static class DefaultGroup extends BaseGroup
    {
    }
    
-   @JBossXmlModelGroup(name="orderedSequence", kind = JBossXmlConstants.MODEL_GROUP_SEQUENCE)
+   @JBossXmlModelGroup(name="orderedSequence", kind = JBossXmlConstants.MODEL_GROUP_SEQUENCE, propOrder={"a", "b"})
    public static class OrderedSequence extends BaseGroup
    {
    }




More information about the jboss-svn-commits mailing list