jochen      2005/07/08 13:44:02

  Modified:    src/xs/org/apache/ws/jaxme/xs/junit ParserTest.java
               src/jaxme/org/apache/ws/jaxme/generator/sg/impl
                        JAXBGroupSG.java JAXBComplexContentTypeSG.java
                        JAXBParticleSG.java JAXBComplexTypeSG.java
                        JAXBSchemaSG.java
               .        status.xml
               src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg
                        GroupHandlerSG.java ParticleWalker.java
               src/pm/org/apache/ws/jaxme/pm/generator/jdbc
                        JaxMeJdbcSG.java
               src/test/jaxb build.xml
               src/jaxme/org/apache/ws/jaxme/generator/sg
                        ComplexContentSG.java
               src/jaxme/org/apache/ws/jaxme/junit ParserTest.java
  Log:
  Fixed that the generator didn't detect and refuse a complex type with a group 
of muliplicity > 1.
  
  Revision  Changes    Path
  1.25      +31 -0     
ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java
  
  Index: ParserTest.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ParserTest.java   19 May 2005 20:30:33 -0000      1.24
  +++ ParserTest.java   8 Jul 2005 20:43:30 -0000       1.25
  @@ -1520,4 +1520,35 @@
                testRecursiveXsInclude(newXSParser());
                testRecursiveXsInclude(newJAXBParser());
        }
  +
  +
  +     private void testGroupMultiplicity(XSParser pParser) throws Exception {
  +             final String schemaSource =
  +                     "<xs:schema 
xmlns:xs='http://www.w3.org/2001/XMLSchema'>\n"
  +                     + "<xs:element name='PARAMETERS'>\n"
  +                     + "  <xs:complexType>\n"
  +                     + "    <xs:choice maxOccurs='unbounded'>\n"
  +                     + "      <xs:element name='PARAMETER'/>\n"
  +                     + "      <xs:element name='SYSTEMPARAMETER'/>\n"
  +                     + "      <xs:element name='PREPREF'/>\n"
  +                     + "    </xs:choice>\n"
  +                     + "  </xs:complexType>\n"
  +                     + "</xs:element></xs:schema>\n";
  +        InputSource isource = new InputSource(new 
StringReader(schemaSource));
  +        isource.setSystemId("testElementReferenceGlobal.xsd");
  +        XSSchema schema = pParser.parse(isource);
  +        XSElement[] elements = schema.getElements();
  +        assertEquals(1, elements.length);
  +        XSElement parameters = elements[0];
  +        XSParticle particle = 
assertComplexContent(assertComplexType(parameters.getType()));
  +        assertEquals(1, particle.getMinOccurs());
  +        assertEquals(-1, particle.getMaxOccurs());
  +     }
  +
  +     /** Test the representation of groups with multiplicity > 1.
  +      */
  +     public void testGroupMultiplicity() throws Exception {
  +             testGroupMultiplicity(newXSParser());
  +             testGroupMultiplicity(newJAXBParser());
  +     }
   }
  
  
  
  1.21      +1 -1      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java
  
  Index: JAXBGroupSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- JAXBGroupSG.java  14 Mar 2005 02:16:09 -0000      1.20
  +++ JAXBGroupSG.java  8 Jul 2005 20:43:31 -0000       1.21
  @@ -64,7 +64,7 @@
        }
        
        public Object newParticleSG(GroupSG pController, XSParticle pParticle) 
throws SAXException {
  -             return new JAXBParticleSG(pController, pParticle, classContext);
  +             return new JAXBParticleSG(pController.getFactory(), pParticle, 
classContext);
        }
        
        public Context getClassContext(GroupSG pController) { return 
classContext; }
  
  
  
  1.10      +17 -8     
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexContentTypeSG.java
  
  Index: JAXBComplexContentTypeSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexContentTypeSG.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JAXBComplexContentTypeSG.java     29 Apr 2005 09:55:27 -0000      1.9
  +++ JAXBComplexContentTypeSG.java     8 Jul 2005 20:43:31 -0000       1.10
  @@ -21,9 +21,11 @@
   import org.apache.ws.jaxme.generator.sg.ComplexContentSG;
   import org.apache.ws.jaxme.generator.sg.ComplexContentSGChain;
   import org.apache.ws.jaxme.generator.sg.ComplexTypeSG;
  +import org.apache.ws.jaxme.generator.sg.Context;
   import org.apache.ws.jaxme.generator.sg.GroupSG;
   import org.apache.ws.jaxme.generator.sg.ObjectSG;
   import org.apache.ws.jaxme.generator.sg.ParticleSG;
  +import org.apache.ws.jaxme.generator.sg.SGFactory;
   import org.apache.ws.jaxme.logging.Logger;
   import org.apache.ws.jaxme.logging.LoggerAccess;
   import org.apache.ws.jaxme.xs.XSGroup;
  @@ -61,8 +63,9 @@
               return anchestor;
           }
       }
  -    private final GroupSG groupSG;
  -     private final boolean isEmpty, isMixed;
  +
  +    private final boolean isEmpty, isMixed;
  +    private final ParticleSG rootParticle;
   
       private boolean isInitialized;
       private final Locator locator;
  @@ -79,17 +82,16 @@
                }
                locator = pType.getLocator();
                if (pType.getComplexType().isEmpty()) {
  -                     groupSG = null;
                        isEmpty = true;
                        isMixed = false;
  +                     rootParticle = null;
                } else {
                        XSParticle particle = 
pType.getComplexType().getParticle();
                        if (particle == null) {
                                throw new NullPointerException("Missing group 
particle for type = " + pType.getName());
                        }
                        if (particle.isGroup()) {
  -                             XSGroup group = particle.getGroup();
  -                             groupSG = 
pComplexTypeSG.getTypeSG().getFactory().getGroupSG(group, 
pComplexTypeSG.getClassContext());
  +                             rootParticle = 
newParticleSG(pComplexTypeSG.getTypeSG().getFactory(), particle, 
pComplexTypeSG.getClassContext());
                        } else {
                                throw new IllegalStateException("Expected 
internal group");
                        }
  @@ -98,6 +100,13 @@
                }
        }
   
  +     protected ParticleSG newParticleSG(SGFactory pFactory, XSParticle 
pParticle, Context pContext) throws SAXException {
  +             JAXBParticleSG chain = new JAXBParticleSG(pFactory, pParticle, 
pContext);
  +             ParticleSGImpl result = new ParticleSGImpl(chain);
  +             result.init();
  +             return result;
  +     }
  +
       public Locator getLocator(ComplexContentSG pController) { return 
locator; }
   
        public void init(ComplexContentSG pController) throws SAXException {
  @@ -129,8 +138,8 @@
                return result;
        }
   
  -     public GroupSG getGroupSG(ComplexContentSG pController) {
  -        return groupSG;
  +     public ParticleSG getRootParticle(ComplexContentSG pController) {
  +        return rootParticle;
        }
        
        public boolean isEmpty(ComplexContentSG pController) {
  @@ -175,7 +184,7 @@
        * to the JAXB 1.0 specification, 5.9.7.
        */
       private void verify(ComplexContentSG pController) throws SAXException {
  -        findParticles(pController.getGroupSG());
  +        findParticles(new GroupSG[0], pController.getRootParticle());
   
           /* 5.9.7, 1) If {content type} is mixed, bind the entire content 
model
            * to a general content property with the content-property name 
"content".
  
  
  
  1.10      +6 -9      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBParticleSG.java
  
  Index: JAXBParticleSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBParticleSG.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JAXBParticleSG.java       24 Apr 2005 20:16:48 -0000      1.9
  +++ JAXBParticleSG.java       8 Jul 2005 20:43:31 -0000       1.10
  @@ -30,9 +30,6 @@
   import org.apache.ws.jaxme.xs.XSAny;
   import org.apache.ws.jaxme.xs.XSElement;
   import org.apache.ws.jaxme.xs.XSParticle;
  -import org.apache.ws.jaxme.xs.impl.XSUtil;
  -import org.apache.ws.jaxme.xs.jaxb.JAXBElement;
  -import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
   
  @@ -52,24 +49,24 @@
   
       /** <p>Creates a new instance of JAXBParticleSG.java.</p>
        */
  -    public JAXBParticleSG(GroupSG pGroup, XSParticle pParticle, Context 
pClassContext) throws SAXException {
  +    public JAXBParticleSG(SGFactory pFactory, XSParticle pParticle,
  +                                       Context pClassContext) throws 
SAXException {
           minOccurs = pParticle.getMinOccurs();
           maxOccurs = pParticle.getMaxOccurs();
           type = pParticle.getType();
  -        SGFactory factory = pGroup.getFactory();
           if (pParticle.isGroup()) {
  -            groupSG = factory.getGroupSG(pParticle.getGroup(), 
pClassContext);
  +            groupSG = pFactory.getGroupSG(pParticle.getGroup(), 
pClassContext);
               objectSG = null;
            } else if (pParticle.isElement()) {
               element = pParticle.getElement();
               if (element.isGlobal()) {
  -                objectSG = factory.getObjectSG(element);
  +                objectSG = pFactory.getObjectSG(element);
               } else {
  -             objectSG = factory.getObjectSG(element, pClassContext);
  +             objectSG = pFactory.getObjectSG(element, pClassContext);
               }
                groupSG = null;
                } else if (pParticle.isWildcard()) {
  -             objectSG = factory.getObjectSG(pParticle.getWildcard(), 
pClassContext);
  +             objectSG = pFactory.getObjectSG(pParticle.getWildcard(), 
pClassContext);
                groupSG = null;
                wildcard = pParticle.getWildcard();
            } else {
  
  
  
  1.20      +1 -1      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java
  
  Index: JAXBComplexTypeSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JAXBComplexTypeSG.java    6 Jul 2005 21:34:13 -0000       1.19
  +++ JAXBComplexTypeSG.java    8 Jul 2005 20:43:31 -0000       1.20
  @@ -277,7 +277,7 @@
                        if (ccSG.isEmpty()) {
                                return new EmptyElementHandlerSG(pController, 
pJs);
                        } else {
  -                             GroupSG group = ccSG.getGroupSG();
  +                             GroupSG group = 
ccSG.getRootParticle().getGroupSG();
                                if (group.isSequence()) {
                                        return new 
SequenceHandlerSG(pController, pJs);
                                } else if (group.isChoice()) {
  
  
  
  1.17      +28 -21    
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java
  
  Index: JAXBSchemaSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBSchemaSG.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JAXBSchemaSG.java 19 Apr 2005 20:11:14 -0000      1.16
  +++ JAXBSchemaSG.java 8 Jul 2005 20:43:31 -0000       1.17
  @@ -524,31 +524,38 @@
          generateCreateMethods(pJs, pType, prefix, pContextSet);
     }
   
  +  /** Generate create methods for the given particle.
  +   */
  +  private void generateCreateMethods(JavaSource pJs, ParticleSG pParticle,
  +                                                                     String 
pName, Set pContextSet)
  +             throws SAXException {
  +       if (pParticle.isGroup()) {
  +               GroupSG group = pParticle.getGroupSG();
  +               generateCreateMethods(pJs, group.getParticles(), pName, 
pContextSet);
  +       } else if (pParticle.isElement()) {
  +               ObjectSG oSG = pParticle.getObjectSG();
  +               if (oSG.isGlobal()) {
  +                       return;  // Will be generated elsewhere
  +               }
  +               TypeSG tSG = oSG.getTypeSG();
  +               if (tSG.isGlobalType()) {
  +                       return;  // Will be generated elsewhere
  +               }
  +               generateCreateMethod(pJs, pContextSet, tSG, pName);
  +       } else if (pParticle.isWildcard()) {
  +               throw new IllegalStateException("TODO: Add support for 
wildcards here.");
  +       } else {
  +               throw new IllegalStateException("Invalid class type");
  +       }
  +  }
  +
     /** Generate create methods for the given particles.
      */
     private void generateCreateMethods(JavaSource pJs, ParticleSG[] pParticles,
                                                                         String 
pName, Set pContextSet)
                throws SAXException {
          for (int i = 0;  i < pParticles.length;  i++) {
  -               ParticleSG particle = pParticles[i];
  -               if (particle.isGroup()) {
  -                       GroupSG group = particle.getGroupSG();
  -                       generateCreateMethods(pJs, group.getParticles(), 
pName, pContextSet);
  -               } else if (particle.isElement()) {
  -                       ObjectSG oSG = particle.getObjectSG();
  -                       if (oSG.isGlobal()) {
  -                               continue;  // Will be generated elsewhere
  -                       }
  -                       TypeSG tSG = oSG.getTypeSG();
  -                       if (tSG.isGlobalType()) {
  -                               continue;  // Will be generated elsewhere
  -                       }
  -                       generateCreateMethod(pJs, pContextSet, tSG, pName);
  -               } else if (particle.isWildcard()) {
  -                       throw new IllegalStateException("TODO: Add support 
for wildcards here.");
  -               } else {
  -                       throw new IllegalStateException("Invalid class type");
  -               }
  +               generateCreateMethods(pJs, pParticles[i], pName, pContextSet);
          }
     }
   
  @@ -565,8 +572,8 @@
          if (ccSG.isEmpty()) {
                  return;
          }
  -       GroupSG group = ccSG.getGroupSG();
  -       generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
  +       ParticleSG particle = ccSG.getRootParticle();
  +       generateCreateMethods(pJs, particle, pName, pContextSet);
     }
   
     /**
  
  
  
  1.60      +4 -0      ws-jaxme/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/status.xml,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- status.xml        8 Jul 2005 14:45:07 -0000       1.59
  +++ status.xml        8 Jul 2005 20:43:57 -0000       1.60
  @@ -46,6 +46,10 @@
           The JavaParser didn't handle multidimensional arrays
           properly. (Frederic Ahring, [EMAIL PROTECTED])
         </action>
  +      <action dev="JW" type="fix" context="generator">
  +        Fixed that the generator didn't detect top level groups with
  +        multiplicity > 1 in a complex type.
  +      </action>
        </release>
       <release version="0.4" date="2005-May-19">
         <action dev="JW" type="fix" context="xs">
  
  
  
  1.7       +1 -2      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java
  
  Index: GroupHandlerSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GroupHandlerSG.java       28 Apr 2005 23:57:53 -0000      1.6
  +++ GroupHandlerSG.java       8 Jul 2005 20:43:57 -0000       1.7
  @@ -40,7 +40,6 @@
   import org.apache.ws.jaxme.js.LocalJavaField;
   import org.apache.ws.jaxme.js.Parameter;
   import org.apache.ws.jaxme.js.TypedValue;
  -import org.apache.ws.jaxme.js.impl.TypedValueImpl;
   import org.apache.ws.jaxme.xs.xml.XsQName;
   import org.xml.sax.SAXException;
   
  @@ -70,7 +69,7 @@
                super(pType, pJs);
                outerHandler = this;
                ccSG = pType.getComplexContentSG();
  -             group = ccSG.getGroupSG();
  +             group = ccSG.getRootParticle().getGroupSG();
                particles = group.getParticles();
                isMixed = ccSG.isMixed();
                findGroups(particles);
  
  
  
  1.2       +1 -1      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/ParticleWalker.java
  
  Index: ParticleWalker.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/ParticleWalker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParticleWalker.java       24 Apr 2005 20:16:48 -0000      1.1
  +++ ParticleWalker.java       8 Jul 2005 20:43:57 -0000       1.2
  @@ -34,7 +34,7 @@
                                visitor.emptyType(pType);
                        } else {
                                visitor.startComplexContent(pType);
  -                             walkGroup(ccSG.getGroupSG());
  +                             walkGroup(ccSG.getRootParticle().getGroupSG());
                                visitor.endComplexContent(pType);
                        }
                }
  
  
  
  1.7       +1 -1      
ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
  
  Index: JaxMeJdbcSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JaxMeJdbcSG.java  3 Sep 2004 01:46:12 -0000       1.6
  +++ JaxMeJdbcSG.java  8 Jul 2005 20:43:57 -0000       1.7
  @@ -322,7 +322,7 @@
       }
       if (!pTypeSG.hasSimpleContent()) {
         ComplexContentSG cct = pTypeSG.getComplexContentSG();
  -      GroupSG groupSG = cct.getGroupSG();
  +      GroupSG groupSG = cct.getRootParticle().getGroupSG();
         ParticleSG[] childs = groupSG.getParticles();
         if (childs != null) {
           for (int i = 0;  i < childs.length;  i++) {
  
  
  
  1.18      +1 -1      ws-jaxme/src/test/jaxb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/test/jaxb/build.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- build.xml 6 Mar 2005 02:32:27 -0000       1.17
  +++ build.xml 8 Jul 2005 20:43:57 -0000       1.18
  @@ -120,7 +120,7 @@
         <schema dir="${basedir}">
           <include name="enumeration.xsd"/>
           <include name="wildcards.xsd"/>
  -        <include name="rss.xsd"/>
  +             <!--  <include name="rss.xsd"/>  -->
           <include name="**/xjc*.xsd"/> 
         </schema>
         <produces dir="${srcdir}" 
includes="org/apache/ws/jaxme/test/misc/enumeration/*"/>
  
  
  
  1.9       +2 -4      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/ComplexContentSG.java
  
  Index: ComplexContentSG.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/ComplexContentSG.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ComplexContentSG.java     24 Apr 2005 20:16:48 -0000      1.8
  +++ ComplexContentSG.java     8 Jul 2005 20:43:58 -0000       1.9
  @@ -17,9 +17,7 @@
   
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
  -import org.apache.ws.jaxme.generator.sg.GroupSG;
   import org.apache.ws.jaxme.generator.sg.ParticleSG;
  -import org.apache.ws.jaxme.js.JavaSource;
   
   
   /** Interface of a complex type with a complex content model.
  @@ -41,9 +39,9 @@
         */
        public boolean isMixed();
        
  -     /** <p>Returns the child elements.</p>
  +     /** Returns the complex types root particle.
         */
  -     public GroupSG getGroupSG();
  +     public ParticleSG getRootParticle();
   
        /** Returns a list of all element particles, which are
         * being generated as properties of the type.
  
  
  
  1.9       +9 -9      
ws-jaxme/src/jaxme/org/apache/ws/jaxme/junit/ParserTest.java
  
  Index: ParserTest.java
  ===================================================================
  RCS file: 
/home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/junit/ParserTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ParserTest.java   18 May 2005 22:09:10 -0000      1.8
  +++ ParserTest.java   8 Jul 2005 20:43:58 -0000       1.9
  @@ -338,7 +338,7 @@
       ComplexTypeSG ct3 = t3.getComplexTypeSG();
       assertTrue(!ct3.hasSimpleContent());
       ComplexContentSG cct3 = ct3.getComplexContentSG();
  -    ParticleSG[] childs = cct3.getGroupSG().getParticles();
  +    ParticleSG[] childs = cct3.getRootParticle().getGroupSG().getParticles();
       assertEquals(2, childs.length);
       assertTrue(childs[0].isElement());
       ObjectSG child1 = childs[0].getObjectSG();
  @@ -686,7 +686,7 @@
       assertEquals(new XsQName((String) null, "USAddress"), 
usAddress.getName());
       assertTrue(usAddress.isGlobalType());
       assertTrue(usAddress.isComplex());
  -    
assertTrue(usAddress.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    
assertTrue(usAddress.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // USAddress.country
       //  <xsd:attribute name='country' type='xsd:string' fixed='US'/>
       // ToDo: test attribute fixed='US'
  @@ -697,7 +697,7 @@
       assertEquals(JavaQNameImpl.getInstance(String.class), 
country.getTypeSG().getRuntimeType());
       // USAddress children
       String [] nameShouldBe = {"name", "street", "city",  "state", "zip"};
  -    ParticleSG [] usAddressChildren = 
usAddress.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG [] usAddressChildren = 
usAddress.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(5, usAddressChildren.length);
       for (int i = 0; i < usAddressChildren.length; i++) {
         ParticleSG child = usAddressChildren[i];
  @@ -716,7 +716,7 @@
       ComplexTypeSG itemsComplex = items.getComplexTypeSG();
       assertTrue(!itemsComplex.hasSimpleContent());
       ComplexContentSG itemsComplexContent = 
itemsComplex.getComplexContentSG();
  -    GroupSG group = itemsComplexContent.getGroupSG();
  +    GroupSG group = itemsComplexContent.getRootParticle().getGroupSG();
       assertTrue(group.isSequence());
       // Items.item
       ParticleSG[] itemsChildren = group.getParticles();
  @@ -729,7 +729,7 @@
       TypeSG itemST = item.getObjectSG().getTypeSG();
       assertTrue(itemST.isComplex());
       assertTrue(!itemST.getComplexTypeSG().hasSimpleContent());
  -    
assertTrue(itemST.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    
assertTrue(itemST.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // Items.item.partNum
       // <xsd:attribute name='partNum' type='SKU' use='required'/>
       AttributeSG[] itemAttributes = itemST.getComplexTypeSG().getAttributes();
  @@ -739,7 +739,7 @@
       assertTrue(partNum.isRequired());
       // Items.item.USPrice
       // <xsd:element name='USPrice'  type='xsd:decimal'/> 
  -    ParticleSG[] itemChildren = 
itemST.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG[] itemChildren = 
itemST.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(5, itemChildren.length);
       ParticleSG usPrice = itemChildren[2];
       assertTrue(usPrice.isElement());
  @@ -791,7 +791,7 @@
       assertEquals(new XsQName((String) null, "PurchaseOrderType"), 
purchaseOrderType.getName());
       assertTrue(purchaseOrderType.isGlobalType());
       assertTrue(purchaseOrderType.isComplex());
  -    
assertTrue(purchaseOrderType.getComplexTypeSG().getComplexContentSG().getGroupSG().isSequence());
  +    
assertTrue(purchaseOrderType.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().isSequence());
       // PurchaseOrderType.orderDate
       // <xsd:attribute name='orderDate' type='xsd:date'/>
       AttributeSG [] potAttributes = 
purchaseOrderType.getComplexTypeSG().getAttributes();
  @@ -800,7 +800,7 @@
       assertEquals(new XsQName((String) null, "orderDate"), 
orderDate.getName());
       assertEquals(JavaQNameImpl.getInstance(Calendar.class), 
                    orderDate.getTypeSG().getSimpleTypeSG().getRuntimeType());
  -    ParticleSG [] potChildren = 
purchaseOrderType.getComplexTypeSG().getComplexContentSG().getGroupSG().getParticles();
  +    ParticleSG [] potChildren = 
purchaseOrderType.getComplexTypeSG().getComplexContentSG().getRootParticle().getGroupSG().getParticles();
       assertEquals(4, potChildren.length);
       // PurchaseOrderType.shipTo
       // <xsd:element name='shipTo' type='USAddress'/> 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to