[jboss-svn-commits] JBoss Common SVN: r3059 - in jbossxb/trunk/src/test: resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Mar 12 04:31:24 EDT 2009


Author: alex.loubyansky at jboss.com
Date: 2009-03-12 04:31:24 -0400 (Thu, 12 Mar 2009)
New Revision: 3059

Added:
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/AbstractJBossXmlModelGroupTest.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionBindingTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.java
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.xml
Removed:
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroupUnitTestCase.java
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testChoiceCollectionXmlTypeUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceCollectionUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllCollectionUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceCollectionUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceCollectionUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoParticleGroupsUnmarshalling.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoPropertyGroupsUnmarshalling.xml
Log:
refactored JBossXmlModelGroup tests to one test per class to make it easier to include/exclude from execution

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/AbstractJBossXmlModelGroupTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/AbstractJBossXmlModelGroupTest.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/AbstractJBossXmlModelGroupTest.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,240 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+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.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A JBossXmlModelGroupUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractJBossXmlModelGroupTest extends AbstractBuilderTest
+{
+   public AbstractJBossXmlModelGroupTest(String name)
+   {
+      super(name);
+   }
+
+   protected void assertParticleChoiceBinding(ModelGroupBinding s)
+   {
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+      
+      ParticleBinding choiceParticle;
+      ParticleBinding elementParticle;
+      if(s instanceof SequenceBinding)
+      {
+         choiceParticle = i.next();
+         elementParticle = i.next();
+      }
+      else
+      {
+         ParticleBinding p = i.next();
+         if(p.getTerm().isModelGroup())
+         {
+            choiceParticle = p;
+            elementParticle = i.next();
+         }
+         else
+         {
+            elementParticle = p;
+            choiceParticle = i.next();
+         }
+      }
+      
+      TermBinding t = choiceParticle.getTerm();
+      assertTrue(t instanceof ChoiceBinding);
+      assertEquals(1, choiceParticle.getMaxOccurs());
+      assertFalse(choiceParticle.getMaxOccursUnbounded());
+      
+      ChoiceBinding c = (ChoiceBinding) t;
+      particles = c.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> choiceIter = particles.iterator();
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
+      
+      t = elementParticle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
+   }
+
+   protected void assertPropertiesSequenceBinding(Class<?> root, boolean inCollection)
+   {
+      SchemaBinding schema = JBossXBBuilder.build(root);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+      assertPropertiesSequenceBinding(s, inCollection);
+   }
+
+   protected void assertPropertiesSequenceBinding(ModelGroupBinding s, boolean inCollection)
+   {
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(1, particles.size());
+      ParticleBinding p = particles.iterator().next();
+      if(p.getTerm() instanceof SequenceBinding)
+         assertABCGroupParticle(p, true, inCollection);
+      else
+         assertABCGroupParticle(p, false, inCollection);
+   }
+
+   protected void assertPropertiesChoiceBinding(Class<?> root, boolean inCollection)
+   {
+      SchemaBinding schema = JBossXBBuilder.build(root);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(1, particles.size());
+      ParticleBinding p = particles.iterator().next();
+      t = p.getTerm();
+      assertTrue(t instanceof ChoiceBinding);
+      //assertEquals(0, p.getMinOccurs());
+      assertEquals(1, p.getMaxOccurs());
+      assertEquals(inCollection, p.getMaxOccursUnbounded());
+      ChoiceBinding c = (ChoiceBinding) t;
+      particles = c.getParticles();
+      assertEquals(3, particles.size());
+      
+      Set<QName> set = new HashSet<QName>();
+      set.add(new QName("c"));
+      set.add(new QName("b"));
+      set.add(new QName("a"));
+
+      for(ParticleBinding cp : particles)
+      {
+         t = cp.getTerm();
+         assertTrue(t.isElement());
+         assertTrue(set.contains(((ElementBinding) t).getQName()));
+      }
+   }
+
+   protected void assertPropertiesAllBinding(Class<?> root, boolean inCollection)
+   {
+      SchemaBinding schema = JBossXBBuilder.build(root);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+
+      ParticleBinding groupParticle = null;
+      ParticleBinding elementParticle = null;
+      if(s instanceof SequenceBinding)
+      {
+         groupParticle = i.next();
+         elementParticle = i.next();
+      }
+      else
+      {
+         groupParticle = i.next();
+         if(groupParticle.getTerm().isElement())
+         {
+            elementParticle = groupParticle;
+            groupParticle = i.next();
+         }
+         else
+            elementParticle = i.next();
+      }
+
+      assertTrue(groupParticle.getTerm() instanceof AllBinding);
+      assertABCGroupParticle(groupParticle, false, inCollection);
+      
+      t = elementParticle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, elementParticle.getMinOccurs());
+      assertEquals(1, elementParticle.getMaxOccurs());
+      assertFalse(elementParticle.getMaxOccursUnbounded());
+      assertEquals(new QName("prop"), ((ElementBinding)t).getQName());
+   }
+
+   protected void assertABCGroupParticle(ParticleBinding p, boolean ordered, boolean inCollection)
+   {
+      Collection<ParticleBinding> particles;
+      assertEquals(1, p.getMaxOccurs());
+      assertEquals(inCollection, p.getMaxOccursUnbounded());
+      ModelGroupBinding group = (ModelGroupBinding) p.getTerm();
+      particles = group.getParticles();
+      assertEquals(3, particles.size());
+
+      if (ordered)
+      {
+         Iterator<ParticleBinding> i = particles.iterator();
+         TermBinding t = i.next().getTerm();
+         assertTrue(t.isElement());
+         assertEquals(new QName("c"), ((ElementBinding) t).getQName());
+         t = i.next().getTerm();
+         assertTrue(t.isElement());
+         assertEquals(new QName("b"), ((ElementBinding) t).getQName());
+         t = i.next().getTerm();
+         assertTrue(t.isElement());
+         assertEquals(new QName("a"), ((ElementBinding) t).getQName());
+      }
+      else
+      {
+         Set<QName> set = new HashSet<QName>();
+         set.add(new QName("c"));
+         set.add(new QName("b"));
+         set.add(new QName("a"));
+
+         for (ParticleBinding cp : particles)
+         {
+            TermBinding t = cp.getTerm();
+            assertTrue(t.isElement());
+            assertTrue(set.contains(((ElementBinding) t).getQName()));
+         }
+      }
+   }
+}

Deleted: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroupUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroupUnitTestCase.java	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroupUnitTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,703 +0,0 @@
-/*
- * 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.object.type.jbossxmlmodelgroup.test;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.test.xb.builder.AbstractBuilderTest;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.AbstractChoice;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceA;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceB;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceCollectionXmlType;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesAll;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesChoice;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesSequence;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithChoiceCollectionXmlType;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoice;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoiceCollection;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAll;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAllCollection;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesChoice;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesChoiceCollection;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequence;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequenceCollection;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoParticleGroups;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups.GroupWrapper1;
-import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups.GroupWrapper2;
-import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
-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.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.UnorderedSequenceBinding;
-import org.jboss.xb.builder.JBossXBBuilder;
-
-/**
- * A JBossXmlModelGroupUnitTestCase.
- * 
- * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
- * @version $Revision: 1.1 $
- */
-public class JBossXmlModelGroupUnitTestCase extends AbstractBuilderTest
-{
-   public JBossXmlModelGroupUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   public void testPropertiesSequenceUnmarshalling() throws Exception
-   {
-      RootWithPropertiesSequence o = unmarshalObject(RootWithPropertiesSequence.class);
-      PropertiesSequence g = o.getGroup();
-      assertNotNull(g);
-      assertEquals("a", g.getA());
-      assertEquals("b", g.getB());
-      assertEquals("c", g.getC());
-   }
-
-   public void testRootWithTwoPropertyGroupsUnmarshalling() throws Exception
-   {
-      RootWithTwoPropertyGroups o = unmarshalObject(RootWithTwoPropertyGroups.class);
-      GroupWrapper1 gw1 = o.getGroup1();
-      assertNotNull(gw1);
-      PropertiesSequence g = gw1.getGroup();
-      assertNotNull(g);
-      assertEquals("a", g.getA());
-      assertEquals("b", g.getB());
-      assertEquals("c", g.getC());
-      
-      GroupWrapper2 gw2 = o.getGroup2();
-      assertNotNull(gw2);
-      g = gw2.getGroup();
-      assertNotNull(g);
-      assertEquals("a", g.getA());
-      assertEquals("b", g.getB());
-      assertEquals("c", g.getC());
-   }
-
-   public void testPropertiesSequenceCollectionUnmarshalling() throws Exception
-   {
-      RootWithPropertiesSequenceCollection o = unmarshalObject(RootWithPropertiesSequenceCollection.class);
-      List<PropertiesSequence> gs = o.getGroups();
-      assertNotNull(gs);
-      assertEquals(2, gs.size());
-      int i = 0;
-      for(PropertiesSequence g : gs)
-      {
-         assertNotNull(g);
-         ++i;
-         assertEquals("a" + i, g.getA());
-         assertEquals("b" + i, g.getB());
-         assertEquals("c" + i, g.getC());
-      }
-   }
-
-   public void testPropertiesChoiceUnmarshalling() throws Exception
-   {
-      RootWithPropertiesChoice o = unmarshalObject(RootWithPropertiesChoice.class);
-      PropertiesChoice g = o.getGroup();
-      assertNotNull(g);
-      assertNull(g.getA());
-      assertNull(g.getB());
-      assertEquals("c", g.getC());
-   }
-
-   public void testPropertiesChoiceCollectionUnmarshalling() throws Exception
-   {
-      RootWithPropertiesChoiceCollection o = unmarshalObject(RootWithPropertiesChoiceCollection.class);
-      List<PropertiesChoice> gs = o.getGroups();
-      assertNotNull(gs);
-      assertEquals(3, gs.size());
-      PropertiesChoice g = gs.get(0);
-      assertEquals("c", g.getC());
-      assertNull(g.getA());
-      assertNull(g.getB());
-      g = gs.get(1);
-      assertNull(g.getC());
-      assertNull(g.getA());
-      assertEquals("b", g.getB());
-      g = gs.get(2);
-      assertEquals("a", g.getA());
-      assertNull(g.getC());
-      assertNull(g.getB());
-   }
-
-   public void testPropertiesAllUnmarshalling() throws Exception
-   {
-      RootWithPropertiesAll o = unmarshalObject(RootWithPropertiesAll.class);
-      PropertiesAll g = o.getGroup();
-      assertNotNull(g);
-      assertEquals("a", g.getA());
-      assertEquals("b", g.getB());
-      assertEquals("c", g.getC());
-      assertEquals("p", o.getProp());
-   }
-
-   public void testPropertiesAllCollectionUnmarshalling() throws Exception
-   {
-      RootWithPropertiesAllCollection o = unmarshalObject(RootWithPropertiesAllCollection.class);
-      List<PropertiesAll> gs = o.getGroups();
-      assertNotNull(gs);
-      assertEquals("this is a known issue with repeatable all", 2, gs.size());
-      PropertiesAll g = gs.get(0);
-      assertEquals("c", g.getC());
-      assertEquals("a", g.getA());
-      assertEquals("b", g.getB());
-      g = gs.get(1);
-      assertEquals("cc", g.getC());
-      assertEquals("aa", g.getA());
-      assertEquals("bb", g.getB());
-   }
-
-   public void testPropertiesSequenceBinding() throws Exception
-   {
-      assertPropertiesSequenceBinding(RootWithPropertiesSequence.class, false);
-   }
-
-   public void testPropertiesSequenceCollectionBinding() throws Exception
-   {
-      assertPropertiesSequenceBinding(RootWithPropertiesSequenceCollection.class, true);
-   }
-
-   public void testPropertiesChoiceBinding() throws Exception
-   {
-      assertPropertiesChoiceBinding(RootWithPropertiesChoice.class, false);
-   }
-
-   public void testPropertiesChoiceCollectionBinding() throws Exception
-   {
-      assertPropertiesChoiceBinding(RootWithPropertiesChoiceCollection.class, true);
-   }
-
-   public void testPropertiesAllBinding() throws Exception
-   {
-      assertPropertiesAllBinding(RootWithPropertiesAll.class, false);
-   }
-
-   public void testPropertiesAllCollectionBinding() throws Exception
-   {
-      assertPropertiesAllBinding(RootWithPropertiesAllCollection.class, true);
-   }
-
-   public void testParticlesChoiceUnmarshalling() throws Exception
-   {
-      RootWithParticlesChoice o = unmarshalObject(RootWithParticlesChoice.class);
-      AbstractChoice choice = o.getChoice();
-      assertNotNull(choice);
-      assertTrue(choice instanceof ChoiceB);
-      assertEquals("b", choice.getValue());
-   }
-
-   public void testRootWithTwoParticleGroupsUnmarshalling() throws Exception
-   {
-      RootWithTwoParticleGroups o = unmarshalObject(RootWithTwoParticleGroups.class);
-      RootWithTwoParticleGroups.GroupWrapper1 group1 = o.getGroup1();
-      assertNotNull(group1);
-      AbstractChoice choice = group1.getGroup();
-      assertNotNull(choice);
-      assertTrue(choice instanceof ChoiceB);
-      assertEquals("b", choice.getValue());
-      
-      RootWithTwoParticleGroups.GroupWrapper2 group2 = o.getGroup2();
-      assertNotNull(group2);
-      choice = group2.getGroup();
-      assertNotNull(choice);
-      assertTrue(choice instanceof ChoiceA);
-      assertEquals("a", choice.getValue());
-   }
-
-   public void testParticlesChoiceCollectionUnmarshalling() throws Exception
-   {
-      RootWithParticlesChoiceCollection o = unmarshalObject(RootWithParticlesChoiceCollection.class);
-      List<AbstractChoice> choices = o.getChoices();
-      assertNotNull(choices);
-      assertEquals(2, choices.size());
-      AbstractChoice choice = choices.get(0);
-      assertTrue(choice instanceof ChoiceA);
-      assertEquals("a", choice.getValue());
-      choice = choices.get(1);
-      assertTrue(choice instanceof ChoiceB);
-      assertEquals("b", choice.getValue());
-   }
-
-   public void testChoiceCollectionXmlTypeUnmarshalling() throws Exception
-   {
-      RootWithChoiceCollectionXmlType o = unmarshalObject(RootWithChoiceCollectionXmlType.class);
-      ChoiceCollectionXmlType choices = o.getChoices();
-      assertEquals("a", choices.getA());
-      assertEquals("e", choices.getE());
-      assertEquals("value", choices.getValue());
-      assertNotNull(choices);
-      assertEquals(2, choices.size());
-      AbstractChoice choice = choices.get(0);
-      assertTrue(choice instanceof ChoiceA);
-      assertEquals("a", choice.getValue());
-      choice = choices.get(1);
-      assertTrue(choice instanceof ChoiceB);
-      assertEquals("b", choice.getValue());
-   }
-
-   public void testParticlesChoiceBinding() throws Exception
-   {
-      SchemaBinding schema = JBossXBBuilder.build(RootWithParticlesChoice.class);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-      assertParticleChoiceBinding(s);
-   }
-
-   private void assertParticleChoiceBinding(ModelGroupBinding s)
-   {
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-      
-      ParticleBinding choiceParticle;
-      ParticleBinding elementParticle;
-      if(s instanceof SequenceBinding)
-      {
-         choiceParticle = i.next();
-         elementParticle = i.next();
-      }
-      else
-      {
-         ParticleBinding p = i.next();
-         if(p.getTerm().isModelGroup())
-         {
-            choiceParticle = p;
-            elementParticle = i.next();
-         }
-         else
-         {
-            elementParticle = p;
-            choiceParticle = i.next();
-         }
-      }
-      
-      TermBinding t = choiceParticle.getTerm();
-      assertTrue(t instanceof ChoiceBinding);
-      assertEquals(1, choiceParticle.getMaxOccurs());
-      assertFalse(choiceParticle.getMaxOccursUnbounded());
-      
-      ChoiceBinding c = (ChoiceBinding) t;
-      particles = c.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> choiceIter = particles.iterator();
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
-      
-      t = elementParticle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
-   }
-
-   public void testChoiceCollectionXmlTypeBinding() throws Exception
-   {
-      SchemaBinding schema = JBossXBBuilder.build(RootWithChoiceCollectionXmlType.class);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TypeBinding type = e.getType();
-      TermBinding t = type.getParticle().getTerm();
-      assertNull(type.getSimpleType());
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(1, particles.size());
-      ParticleBinding p = particles.iterator().next();
-      t = p.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, p.getMinOccurs());
-      assertEquals(1, p.getMaxOccurs());
-      assertFalse(p.getMaxOccursUnbounded());
-      e = (ElementBinding)t;
-      assertEquals(new QName("choices"), e.getQName());
-      type = e.getType();
-      assertEquals(1, type.getAttributes().size());
-      assertNotNull(type.getAttribute(new QName("a")));
-      assertNotNull(type.getSimpleType());
-      
-      t = type.getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      particles = ((ModelGroupBinding)t).getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-      
-      ParticleBinding choiceParticle;
-      ParticleBinding elementParticle;
-      if(t instanceof SequenceBinding)
-      {
-         elementParticle = i.next();
-         choiceParticle = i.next();
-      }
-      else
-      {
-         p = i.next();
-         if (p.getTerm().isElement())
-         {
-            elementParticle = p;
-            choiceParticle = i.next();
-         }
-         else
-         {
-            choiceParticle = p;
-            elementParticle = i.next();
-         }
-      }
-
-      t = elementParticle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, elementParticle.getMinOccurs());
-      assertEquals(1, elementParticle.getMaxOccurs());
-      assertFalse(elementParticle.getMaxOccursUnbounded());
-      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
-      
-      t = choiceParticle.getTerm();
-      assertTrue(t instanceof ChoiceBinding);
-      assertEquals(1, choiceParticle.getMaxOccurs());
-      assertTrue(choiceParticle.getMaxOccursUnbounded());
-      
-      ChoiceBinding c = (ChoiceBinding) t;
-      particles = c.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> choiceIter = particles.iterator();
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
-   }
-
-   public void testParticlesChoiceCollectionBinding() throws Exception
-   {
-      SchemaBinding schema = JBossXBBuilder.build(RootWithParticlesChoiceCollection.class);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-      
-
-      ParticleBinding choiceParticle;
-      ParticleBinding elementParticle;
-      if(t instanceof SequenceBinding)
-      {
-         choiceParticle = i.next();
-         elementParticle = i.next();
-      }
-      else
-      {
-         ParticleBinding p = i.next();
-         if (p.getTerm().isElement())
-         {
-            elementParticle = p;
-            choiceParticle = i.next();
-         }
-         else
-         {
-            choiceParticle = p;
-            elementParticle = i.next();
-         }
-      }
-      
-      t = choiceParticle.getTerm();
-      assertTrue(t instanceof ChoiceBinding);
-      assertEquals(1, choiceParticle.getMaxOccurs());
-      assertTrue(choiceParticle.getMaxOccursUnbounded());
-      
-      ChoiceBinding c = (ChoiceBinding) t;
-      particles = c.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> choiceIter = particles.iterator();
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
-      t = choiceIter.next().getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
-      
-      t = elementParticle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
-   }
-
-   public void testRootWithTwoPropertyGroupsBinding() throws Exception
-   {
-      SchemaBinding schema = JBossXBBuilder.build(RootWithTwoPropertyGroups.class);
-      ElementBinding e = schema.getElement(new QName("main-root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      Collection<ParticleBinding> particles = ((ModelGroupBinding)t).getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-      
-      ParticleBinding group1Particle;
-      ParticleBinding group2Particle;
-      if(t instanceof SequenceBinding)
-      {
-         group1Particle = i.next();
-         group2Particle = i.next();
-      }
-      else
-      {
-         ParticleBinding p = i.next();
-         if(((ElementBinding)p.getTerm()).getQName().equals(new QName("group1")))
-         {
-            group1Particle = p;
-            group2Particle = i.next();
-         }
-         else
-         {
-            group2Particle = p;
-            group1Particle = i.next();
-         }
-      }
-      
-      t = group1Particle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, group1Particle.getMinOccurs());
-      assertEquals(1, group1Particle.getMaxOccurs());
-      assertFalse(group1Particle.getMaxOccursUnbounded());
-      ElementBinding e1 = (ElementBinding) t;
-      assertEquals(new QName("group1"), e1.getQName());
-      assertPropertiesSequenceBinding((ModelGroupBinding)e1.getType().getParticle().getTerm(), false);
-      
-      t = group2Particle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, group2Particle.getMinOccurs());
-      assertEquals(1, group2Particle.getMaxOccurs());
-      assertFalse(group2Particle.getMaxOccursUnbounded());
-      e1 = (ElementBinding) t;
-      assertEquals(new QName("group2"), e1.getQName());
-      assertPropertiesSequenceBinding((ModelGroupBinding)e1.getType().getParticle().getTerm(), false);
-   }
-
-   public void testRootWithTwoParticleGroupsBinding() throws Exception
-   {
-      SchemaBinding schema = JBossXBBuilder.build(RootWithTwoParticleGroups.class);
-      ElementBinding e = schema.getElement(new QName("main-root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      Collection<ParticleBinding> particles = ((ModelGroupBinding)t).getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-      
-      ParticleBinding group1Particle;
-      ParticleBinding group2Particle;
-      if(t instanceof SequenceBinding)
-      {
-         group1Particle = i.next();
-         group2Particle = i.next();
-      }
-      else
-      {
-         ParticleBinding p = i.next();
-         if(((ElementBinding)p.getTerm()).getQName().equals(new QName("group1")))
-         {
-            group1Particle = p;
-            group2Particle = i.next();
-         }
-         else
-         {
-            group2Particle = p;
-            group1Particle = i.next();
-         }
-      }
-      
-      t = group1Particle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, group1Particle.getMinOccurs());
-      assertEquals(1, group1Particle.getMaxOccurs());
-      assertFalse(group1Particle.getMaxOccursUnbounded());
-      e = (ElementBinding) t;
-      assertEquals(new QName("group1"), e.getQName());
-      assertParticleChoiceBinding((ModelGroupBinding) e.getType().getParticle().getTerm());
-      
-      t = group2Particle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, group2Particle.getMinOccurs());
-      assertEquals(1, group2Particle.getMaxOccurs());
-      assertFalse(group2Particle.getMaxOccursUnbounded());
-      e = (ElementBinding) t;
-      assertEquals(new QName("group2"), e.getQName());
-      assertParticleChoiceBinding((ModelGroupBinding) e.getType().getParticle().getTerm());
-   }
-
-   private void assertPropertiesSequenceBinding(Class<?> root, boolean inCollection)
-   {
-      SchemaBinding schema = JBossXBBuilder.build(root);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-      assertPropertiesSequenceBinding(s, inCollection);
-   }
-
-   private void assertPropertiesSequenceBinding(ModelGroupBinding s, boolean inCollection)
-   {
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(1, particles.size());
-      ParticleBinding p = particles.iterator().next();
-      if(p.getTerm() instanceof SequenceBinding)
-         assertABCGroupParticle(p, true, inCollection);
-      else
-         assertABCGroupParticle(p, false, inCollection);
-   }
-
-   private void assertPropertiesChoiceBinding(Class<?> root, boolean inCollection)
-   {
-      SchemaBinding schema = JBossXBBuilder.build(root);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(1, particles.size());
-      ParticleBinding p = particles.iterator().next();
-      t = p.getTerm();
-      assertTrue(t instanceof ChoiceBinding);
-      //assertEquals(0, p.getMinOccurs());
-      assertEquals(1, p.getMaxOccurs());
-      assertEquals(inCollection, p.getMaxOccursUnbounded());
-      ChoiceBinding c = (ChoiceBinding) t;
-      particles = c.getParticles();
-      assertEquals(3, particles.size());
-      
-      Set<QName> set = new HashSet<QName>();
-      set.add(new QName("c"));
-      set.add(new QName("b"));
-      set.add(new QName("a"));
-
-      for(ParticleBinding cp : particles)
-      {
-         t = cp.getTerm();
-         assertTrue(t.isElement());
-         assertTrue(set.contains(((ElementBinding) t).getQName()));
-      }
-   }
-
-   private void assertPropertiesAllBinding(Class<?> root, boolean inCollection)
-   {
-      SchemaBinding schema = JBossXBBuilder.build(root);
-      ElementBinding e = schema.getElement(new QName("root"));
-      assertNotNull(e);
-      TermBinding t = e.getType().getParticle().getTerm();
-      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
-      ModelGroupBinding s = (ModelGroupBinding) t;
-
-      Collection<ParticleBinding> particles = s.getParticles();
-      assertEquals(2, particles.size());
-      Iterator<ParticleBinding> i = particles.iterator();
-
-      ParticleBinding groupParticle = null;
-      ParticleBinding elementParticle = null;
-      if(s instanceof SequenceBinding)
-      {
-         groupParticle = i.next();
-         elementParticle = i.next();
-      }
-      else
-      {
-         groupParticle = i.next();
-         if(groupParticle.getTerm().isElement())
-         {
-            elementParticle = groupParticle;
-            groupParticle = i.next();
-         }
-         else
-            elementParticle = i.next();
-      }
-
-      assertTrue(groupParticle.getTerm() instanceof AllBinding);
-      assertABCGroupParticle(groupParticle, false, inCollection);
-      
-      t = elementParticle.getTerm();
-      assertTrue(t.isElement());
-      assertEquals(0, elementParticle.getMinOccurs());
-      assertEquals(1, elementParticle.getMaxOccurs());
-      assertFalse(elementParticle.getMaxOccursUnbounded());
-      assertEquals(new QName("prop"), ((ElementBinding)t).getQName());
-   }
-
-   private void assertABCGroupParticle(ParticleBinding p, boolean ordered, boolean inCollection)
-   {
-      Collection<ParticleBinding> particles;
-      assertEquals(1, p.getMaxOccurs());
-      assertEquals(inCollection, p.getMaxOccursUnbounded());
-      ModelGroupBinding group = (ModelGroupBinding) p.getTerm();
-      particles = group.getParticles();
-      assertEquals(3, particles.size());
-
-      if (ordered)
-      {
-         Iterator<ParticleBinding> i = particles.iterator();
-         TermBinding t = i.next().getTerm();
-         assertTrue(t.isElement());
-         assertEquals(new QName("c"), ((ElementBinding) t).getQName());
-         t = i.next().getTerm();
-         assertTrue(t.isElement());
-         assertEquals(new QName("b"), ((ElementBinding) t).getQName());
-         t = i.next().getTerm();
-         assertTrue(t.isElement());
-         assertEquals(new QName("a"), ((ElementBinding) t).getQName());
-      }
-      else
-      {
-         Set<QName> set = new HashSet<QName>();
-         set.add(new QName("c"));
-         set.add(new QName("b"));
-         set.add(new QName("a"));
-
-         for (ParticleBinding cp : particles)
-         {
-            TermBinding t = cp.getTerm();
-            assertTrue(t.isElement());
-            assertTrue(set.contains(((ElementBinding) t).getQName()));
-         }
-      }
-   }
-}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,64 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoice;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+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.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A ParticleChoiceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParticleChoiceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new ParticleChoiceBindingTestCase.
+    * 
+    * @param name
+    */
+   public ParticleChoiceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(RootWithParticlesChoice.class);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+      assertParticleChoiceBinding(s);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,56 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.AbstractChoice;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceB;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoice;
+
+/**
+ * A ParticleChoiceUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParticleChoiceUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new ParticleChoiceUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public ParticleChoiceUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithParticlesChoice o = unmarshalObject(RootWithParticlesChoice.class);
+      AbstractChoice choice = o.getChoice();
+      assertNotNull(choice);
+      assertTrue(choice instanceof ChoiceB);
+      assertEquals("b", choice.getValue());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,49 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAll;
+
+/**
+ * A PropertyAllBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyAllBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new PropertyAllBindingTestCase.
+    * 
+    * @param name
+    */
+   public PropertyAllBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesAllBinding(RootWithPropertiesAll.class, false);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,57 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesAll;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAll;
+
+/**
+ * A PropertyAllUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyAllUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new PropertyAllUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public PropertyAllUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithPropertiesAll o = unmarshalObject(RootWithPropertiesAll.class);
+      PropertiesAll g = o.getGroup();
+      assertNotNull(g);
+      assertEquals("a", g.getA());
+      assertEquals("b", g.getB());
+      assertEquals("c", g.getC());
+      assertEquals("p", o.getProp());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,49 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesChoice;
+
+/**
+ * A PropertyChoiceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyChoiceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new PropertyChoiceBindingTestCase.
+    * 
+    * @param name
+    */
+   public PropertyChoiceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesChoiceBinding(RootWithPropertiesChoice.class, false);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,43 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequence;
+
+/**
+ * A PropertySequenceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertySequenceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+   public PropertySequenceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesSequenceBinding(RootWithPropertiesSequence.class, false);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,50 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesSequence;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequence;
+
+/**
+ * A PropertySequenceUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertySequenceUnmarshallingTestCase extends AbstractBuilderTest
+{
+   public PropertySequenceUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithPropertiesSequence o = unmarshalObject(RootWithPropertiesSequence.class);
+      PropertiesSequence g = o.getGroup();
+      assertNotNull(g);
+      assertEquals("a", g.getA());
+      assertEquals("b", g.getB());
+      assertEquals("c", g.getC());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,114 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoiceCollection;
+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.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A RepeatableParticleChoiceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatableParticleChoiceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new RepeatableParticleChoiceBindingTestCase.
+    * 
+    * @param name
+    */
+   public RepeatableParticleChoiceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(RootWithParticlesChoiceCollection.class);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+      
+
+      ParticleBinding choiceParticle;
+      ParticleBinding elementParticle;
+      if(t instanceof SequenceBinding)
+      {
+         choiceParticle = i.next();
+         elementParticle = i.next();
+      }
+      else
+      {
+         ParticleBinding p = i.next();
+         if (p.getTerm().isElement())
+         {
+            elementParticle = p;
+            choiceParticle = i.next();
+         }
+         else
+         {
+            choiceParticle = p;
+            elementParticle = i.next();
+         }
+      }
+      
+      t = choiceParticle.getTerm();
+      assertTrue(t instanceof ChoiceBinding);
+      assertEquals(1, choiceParticle.getMaxOccurs());
+      assertTrue(choiceParticle.getMaxOccursUnbounded());
+      
+      ChoiceBinding c = (ChoiceBinding) t;
+      particles = c.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> choiceIter = particles.iterator();
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
+      
+      t = elementParticle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,64 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.List;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.AbstractChoice;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceA;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceB;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithParticlesChoiceCollection;
+
+/**
+ * A RepeatableParticleChoiceUnmarshalling.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatableParticleChoiceUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new RepeatableParticleChoiceUnmarshalling.
+    * 
+    * @param name
+    */
+   public RepeatableParticleChoiceUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithParticlesChoiceCollection o = unmarshalObject(RootWithParticlesChoiceCollection.class);
+      List<AbstractChoice> choices = o.getChoices();
+      assertNotNull(choices);
+      assertEquals(2, choices.size());
+      AbstractChoice choice = choices.get(0);
+      assertTrue(choice instanceof ChoiceA);
+      assertEquals("a", choice.getValue());
+      choice = choices.get(1);
+      assertTrue(choice instanceof ChoiceB);
+      assertEquals("b", choice.getValue());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,44 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAllCollection;
+
+/**
+ * A RepeatablePropertyAllBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertyAllBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   public RepeatablePropertyAllBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesAllBinding(RootWithPropertiesAllCollection.class, true);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,64 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.List;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesAll;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesAllCollection;
+
+/**
+ * A RepeatablePropertyAllUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertyAllUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new RepeatablePropertyAllUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public RepeatablePropertyAllUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithPropertiesAllCollection o = unmarshalObject(RootWithPropertiesAllCollection.class);
+      List<PropertiesAll> gs = o.getGroups();
+      assertNotNull(gs);
+      assertEquals("this is a known issue with repeatable all", 2, gs.size());
+      PropertiesAll g = gs.get(0);
+      assertEquals("c", g.getC());
+      assertEquals("a", g.getA());
+      assertEquals("b", g.getB());
+      g = gs.get(1);
+      assertEquals("cc", g.getC());
+      assertEquals("aa", g.getA());
+      assertEquals("bb", g.getB());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,49 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesChoiceCollection;
+
+/**
+ * A RepeatablePropertyChoiceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertyChoiceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new RepeatablePropertyChoiceBindingTestCase.
+    * 
+    * @param name
+    */
+   public RepeatablePropertyChoiceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesChoiceBinding(RootWithPropertiesChoiceCollection.class, true);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,68 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.List;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesChoice;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesChoiceCollection;
+
+/**
+ * A RepeatablePropertyChoiceUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertyChoiceUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new RepeatablePropertyChoiceUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public RepeatablePropertyChoiceUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithPropertiesChoiceCollection o = unmarshalObject(RootWithPropertiesChoiceCollection.class);
+      List<PropertiesChoice> gs = o.getGroups();
+      assertNotNull(gs);
+      assertEquals(3, gs.size());
+      PropertiesChoice g = gs.get(0);
+      assertEquals("c", g.getC());
+      assertNull(g.getA());
+      assertNull(g.getB());
+      g = gs.get(1);
+      assertNull(g.getC());
+      assertNull(g.getA());
+      assertEquals("b", g.getB());
+      g = gs.get(2);
+      assertEquals("a", g.getA());
+      assertNull(g.getC());
+      assertNull(g.getB());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,49 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequenceCollection;
+
+/**
+ * A RepeatablePropertySequenceBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertySequenceBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new RepeatablePropertySequenceBindingTestCase.
+    * 
+    * @param name
+    */
+   public RepeatablePropertySequenceBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      assertPropertiesSequenceBinding(RootWithPropertiesSequenceCollection.class, true);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,59 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.List;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesSequence;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithPropertiesSequenceCollection;
+
+/**
+ * A RepeatablePropertySequenceUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepeatablePropertySequenceUnmarshallingTestCase extends AbstractBuilderTest
+{
+   public RepeatablePropertySequenceUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithPropertiesSequenceCollection o = unmarshalObject(RootWithPropertiesSequenceCollection.class);
+      List<PropertiesSequence> gs = o.getGroups();
+      assertNotNull(gs);
+      assertEquals(2, gs.size());
+      int i = 0;
+      for(PropertiesSequence g : gs)
+      {
+         assertNotNull(g);
+         ++i;
+         assertEquals("a" + i, g.getA());
+         assertEquals("b" + i, g.getB());
+         assertEquals("c" + i, g.getC());
+      }
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,110 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoParticleGroups;
+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.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A RootWithTwoParticleGroupsBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithTwoParticleGroupsBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new RootWithTwoParticleGroupsBindingTestCase.
+    * 
+    * @param name
+    */
+   public RootWithTwoParticleGroupsBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(RootWithTwoParticleGroups.class);
+      ElementBinding e = schema.getElement(new QName("main-root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      Collection<ParticleBinding> particles = ((ModelGroupBinding)t).getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+      
+      ParticleBinding group1Particle;
+      ParticleBinding group2Particle;
+      if(t instanceof SequenceBinding)
+      {
+         group1Particle = i.next();
+         group2Particle = i.next();
+      }
+      else
+      {
+         ParticleBinding p = i.next();
+         if(((ElementBinding)p.getTerm()).getQName().equals(new QName("group1")))
+         {
+            group1Particle = p;
+            group2Particle = i.next();
+         }
+         else
+         {
+            group2Particle = p;
+            group1Particle = i.next();
+         }
+      }
+      
+      t = group1Particle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, group1Particle.getMinOccurs());
+      assertEquals(1, group1Particle.getMaxOccurs());
+      assertFalse(group1Particle.getMaxOccursUnbounded());
+      e = (ElementBinding) t;
+      assertEquals(new QName("group1"), e.getQName());
+      assertParticleChoiceBinding((ModelGroupBinding) e.getType().getParticle().getTerm());
+      
+      t = group2Particle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, group2Particle.getMinOccurs());
+      assertEquals(1, group2Particle.getMaxOccurs());
+      assertFalse(group2Particle.getMaxOccursUnbounded());
+      e = (ElementBinding) t;
+      assertEquals(new QName("group2"), e.getQName());
+      assertParticleChoiceBinding((ModelGroupBinding) e.getType().getParticle().getTerm());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,66 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.AbstractChoice;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceA;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceB;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoParticleGroups;
+
+/**
+ * A RootWithTwoParticleGroupsUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithTwoParticleGroupsUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new RootWithTwoParticleGroupsUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public RootWithTwoParticleGroupsUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithTwoParticleGroups o = unmarshalObject(RootWithTwoParticleGroups.class);
+      RootWithTwoParticleGroups.GroupWrapper1 group1 = o.getGroup1();
+      assertNotNull(group1);
+      AbstractChoice choice = group1.getGroup();
+      assertNotNull(choice);
+      assertTrue(choice instanceof ChoiceB);
+      assertEquals("b", choice.getValue());
+      
+      RootWithTwoParticleGroups.GroupWrapper2 group2 = o.getGroup2();
+      assertNotNull(group2);
+      choice = group2.getGroup();
+      assertNotNull(choice);
+      assertTrue(choice instanceof ChoiceA);
+      assertEquals("a", choice.getValue());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,103 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups;
+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.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A RootWithTwoPropertyGroupsBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithTwoPropertyGroupsBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+   public RootWithTwoPropertyGroupsBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(RootWithTwoPropertyGroups.class);
+      ElementBinding e = schema.getElement(new QName("main-root"));
+      assertNotNull(e);
+      TermBinding t = e.getType().getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      Collection<ParticleBinding> particles = ((ModelGroupBinding)t).getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+      
+      ParticleBinding group1Particle;
+      ParticleBinding group2Particle;
+      if(t instanceof SequenceBinding)
+      {
+         group1Particle = i.next();
+         group2Particle = i.next();
+      }
+      else
+      {
+         ParticleBinding p = i.next();
+         if(((ElementBinding)p.getTerm()).getQName().equals(new QName("group1")))
+         {
+            group1Particle = p;
+            group2Particle = i.next();
+         }
+         else
+         {
+            group2Particle = p;
+            group1Particle = i.next();
+         }
+      }
+      
+      t = group1Particle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, group1Particle.getMinOccurs());
+      assertEquals(1, group1Particle.getMaxOccurs());
+      assertFalse(group1Particle.getMaxOccursUnbounded());
+      ElementBinding e1 = (ElementBinding) t;
+      assertEquals(new QName("group1"), e1.getQName());
+      assertPropertiesSequenceBinding((ModelGroupBinding)e1.getType().getParticle().getTerm(), false);
+      
+      t = group2Particle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, group2Particle.getMinOccurs());
+      assertEquals(1, group2Particle.getMaxOccurs());
+      assertFalse(group2Particle.getMaxOccursUnbounded());
+      e1 = (ElementBinding) t;
+      assertEquals(new QName("group2"), e1.getQName());
+      assertPropertiesSequenceBinding((ModelGroupBinding)e1.getType().getParticle().getTerm(), false);
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,63 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.PropertiesSequence;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups.GroupWrapper1;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithTwoPropertyGroups.GroupWrapper2;
+
+/**
+ * A RootWithTwoPropertyGroupsUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class RootWithTwoPropertyGroupsUnmarshallingTestCase extends AbstractBuilderTest
+{
+   public RootWithTwoPropertyGroupsUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithTwoPropertyGroups o = unmarshalObject(RootWithTwoPropertyGroups.class);
+      GroupWrapper1 gw1 = o.getGroup1();
+      assertNotNull(gw1);
+      PropertiesSequence g = gw1.getGroup();
+      assertNotNull(g);
+      assertEquals("a", g.getA());
+      assertEquals("b", g.getB());
+      assertEquals("c", g.getC());
+      
+      GroupWrapper2 gw2 = o.getGroup2();
+      assertNotNull(gw2);
+      g = gw2.getGroup();
+      assertNotNull(g);
+      assertEquals("a", g.getA());
+      assertEquals("b", g.getB());
+      assertEquals("c", g.getC());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionBindingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionBindingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionBindingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,136 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithChoiceCollectionXmlType;
+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.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.UnorderedSequenceBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A XmlTypeChoiceCollectionBindingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlTypeChoiceCollectionBindingTestCase extends AbstractJBossXmlModelGroupTest
+{
+
+   /**
+    * Create a new XmlTypeChoiceCollectionBindingTestCase.
+    * 
+    * @param name
+    */
+   public XmlTypeChoiceCollectionBindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(RootWithChoiceCollectionXmlType.class);
+      ElementBinding e = schema.getElement(new QName("root"));
+      assertNotNull(e);
+      TypeBinding type = e.getType();
+      TermBinding t = type.getParticle().getTerm();
+      assertNull(type.getSimpleType());
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      ModelGroupBinding s = (ModelGroupBinding) t;
+      Collection<ParticleBinding> particles = s.getParticles();
+      assertEquals(1, particles.size());
+      ParticleBinding p = particles.iterator().next();
+      t = p.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, p.getMinOccurs());
+      assertEquals(1, p.getMaxOccurs());
+      assertFalse(p.getMaxOccursUnbounded());
+      e = (ElementBinding)t;
+      assertEquals(new QName("choices"), e.getQName());
+      type = e.getType();
+      assertEquals(1, type.getAttributes().size());
+      assertNotNull(type.getAttribute(new QName("a")));
+      assertNotNull(type.getSimpleType());
+      
+      t = type.getParticle().getTerm();
+      assertTrue(t instanceof SequenceBinding || t instanceof UnorderedSequenceBinding);
+      particles = ((ModelGroupBinding)t).getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> i = particles.iterator();
+      
+      ParticleBinding choiceParticle;
+      ParticleBinding elementParticle;
+      if(t instanceof SequenceBinding)
+      {
+         elementParticle = i.next();
+         choiceParticle = i.next();
+      }
+      else
+      {
+         p = i.next();
+         if (p.getTerm().isElement())
+         {
+            elementParticle = p;
+            choiceParticle = i.next();
+         }
+         else
+         {
+            choiceParticle = p;
+            elementParticle = i.next();
+         }
+      }
+
+      t = elementParticle.getTerm();
+      assertTrue(t.isElement());
+      assertEquals(0, elementParticle.getMinOccurs());
+      assertEquals(1, elementParticle.getMaxOccurs());
+      assertFalse(elementParticle.getMaxOccursUnbounded());
+      assertEquals(new QName("e"), ((ElementBinding)t).getQName());
+      
+      t = choiceParticle.getTerm();
+      assertTrue(t instanceof ChoiceBinding);
+      assertEquals(1, choiceParticle.getMaxOccurs());
+      assertTrue(choiceParticle.getMaxOccursUnbounded());
+      
+      ChoiceBinding c = (ChoiceBinding) t;
+      particles = c.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> choiceIter = particles.iterator();
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("a"), ((ElementBinding)t).getQName());
+      t = choiceIter.next().getTerm();
+      assertTrue(t.isElement());
+      assertEquals(new QName("b"), ((ElementBinding)t).getQName());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.java	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,66 @@
+/*
+ * 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.object.type.jbossxmlmodelgroup.test;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.AbstractChoice;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceA;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceB;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.ChoiceCollectionXmlType;
+import org.jboss.test.xb.builder.object.type.jbossxmlmodelgroup.support.RootWithChoiceCollectionXmlType;
+
+/**
+ * A XmlTypeChoiceCollectionUnmarshallingTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlTypeChoiceCollectionUnmarshallingTestCase extends AbstractBuilderTest
+{
+
+   /**
+    * Create a new XmlTypeChoiceCollectionUnmarshallingTestCase.
+    * 
+    * @param name
+    */
+   public XmlTypeChoiceCollectionUnmarshallingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnmarshalling() throws Exception
+   {
+      RootWithChoiceCollectionXmlType o = unmarshalObject(RootWithChoiceCollectionXmlType.class);
+      ChoiceCollectionXmlType choices = o.getChoices();
+      assertEquals("a", choices.getA());
+      assertEquals("e", choices.getE());
+      assertEquals("value", choices.getValue());
+      assertNotNull(choices);
+      assertEquals(2, choices.size());
+      AbstractChoice choice = choices.get(0);
+      assertTrue(choice instanceof ChoiceA);
+      assertEquals("a", choice.getValue());
+      choice = choices.get(1);
+      assertTrue(choice instanceof ChoiceB);
+      assertEquals("b", choice.getValue());
+   }
+}

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testChoiceCollectionXmlTypeUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testChoiceCollectionXmlTypeUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testChoiceCollectionXmlTypeUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <choices a="a">
-      value
-      <e>e</e>
-      <a>a</a>
-      <b>b</b>
-   </choices>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceCollectionUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceCollectionUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceCollectionUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <a>a</a>
-   <b>b</b>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testParticlesChoiceUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <b>b</b>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllCollectionUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllCollectionUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllCollectionUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <b>b</b>
-   <c>c</c>
-   <b>bb</b>
-   <a>aa</a>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesAllUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <a>a</a>
-   <c>c</c>
-   <b>b</b>
-   <prop>p</prop>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceCollectionUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceCollectionUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceCollectionUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <c>c</c>
-   <b>b</b>
-   <a>a</a>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesChoiceUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <c>c</c>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceCollectionUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceCollectionUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceCollectionUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <c>c1</c>
-   <b>b1</b>
-   <a>a1</a>
-   <c>c2</c>
-   <b>b2</b>
-   <a>a2</a>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testPropertiesSequenceUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
-   <c>c</c>
-   <b>b</b>
-   <a>a</a>
-</root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoParticleGroupsUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoParticleGroupsUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoParticleGroupsUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<main-root>
-   <group1>
-      <b>b</b>
-   </group1>
-   <group2>
-      <a>a</a>
-   </group2>
-</main-root>

Deleted: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoPropertyGroupsUnmarshalling.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoPropertyGroupsUnmarshalling.xml	2009-03-10 21:02:09 UTC (rev 3058)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/JBossXmlModelGroup_testRootWithTwoPropertyGroupsUnmarshalling.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<main-root>
-   <group1>
-      <c>c</c>
-      <b>b</b>
-      <a>a</a>
-   </group1>
-   <group2>
-      <c>c</c>
-      <b>b</b>
-      <a>a</a>
-   </group2>
-</main-root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/ParticleChoiceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <b>b</b>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyAllUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <a>a</a>
+   <c>c</c>
+   <b>b</b>
+   <prop>p</prop>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertyChoiceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <c>c</c>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/PropertySequenceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <c>c</c>
+   <b>b</b>
+   <a>a</a>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatableParticleChoiceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <a>a</a>
+   <b>b</b>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyAllUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <b>b</b>
+   <c>c</c>
+   <b>bb</b>
+   <a>aa</a>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertyChoiceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <c>c</c>
+   <b>b</b>
+   <a>a</a>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RepeatablePropertySequenceUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <c>c1</c>
+   <b>b1</b>
+   <a>a1</a>
+   <c>c2</c>
+   <b>b2</b>
+   <a>a2</a>
+</root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoParticleGroupsUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<main-root>
+   <group1>
+      <b>b</b>
+   </group1>
+   <group2>
+      <a>a</a>
+   </group2>
+</main-root>

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/RootWithTwoPropertyGroupsUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<main-root>
+   <group1>
+      <c>c</c>
+      <b>b</b>
+      <a>a</a>
+   </group1>
+   <group2>
+      <c>c</c>
+      <b>b</b>
+      <a>a</a>
+   </group2>
+</main-root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/jbossxmlmodelgroup/test/XmlTypeChoiceCollectionUnmarshallingTestCase.xml	2009-03-12 08:31:24 UTC (rev 3059)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+   <choices a="a">
+      value
+      <e>e</e>
+      <a>a</a>
+      <b>b</b>
+   </choices>
+</root>




More information about the jboss-svn-commits mailing list