Index: status.xml
===================================================================
RCS file: /home/cvs/ws-jaxme/status.xml,v
retrieving revision 1.68
diff -u -r1.68 status.xml
--- status.xml	30 Jul 2005 21:12:10 -0000	1.68
+++ status.xml	4 Aug 2005 21:28:14 -0000
@@ -64,6 +64,11 @@
         is now trapped and converted to a proper ValidationEvent.
         (JAXME-62)
       </action>
+      <action dev="JW" type="fix" context="xs">
+        If a complex type was created by referencing a group, then
+        the referencing particles maxOccurs and minOccurs values haven't
+        been inherited. (JAXME-63)
+      </action>
 	</release>
 	<release version="0.5beta" date="2005-Jul-13">
 	  <action dev="JW" type="enhancement" context="generator">
Index: ant/js.xml
===================================================================
RCS file: /home/cvs/ws-jaxme/ant/js.xml,v
retrieving revision 1.7
diff -u -r1.7 js.xml
--- ant/js.xml	14 Jul 2005 18:32:17 -0000	1.7
+++ ant/js.xml	4 Aug 2005 21:28:15 -0000
@@ -180,6 +180,7 @@
                 <sysproperty key="jdbc.url" value="${jdbc.url}"/>
                 <sysproperty key="jdbc.user" value="${jdbc.user}"/>
                 <sysproperty key="jdbc.password" value="${jdbc.password}"/>
+            	<sysproperty key="js.src" value="${src.js}"/>
             </properties>
         </runtests>
     </target>
Index: src/jaxme/org/apache/ws/jaxme/junit/AntlrTest.java
===================================================================
RCS file: src/jaxme/org/apache/ws/jaxme/junit/AntlrTest.java
diff -N src/jaxme/org/apache/ws/jaxme/junit/AntlrTest.java
--- src/jaxme/org/apache/ws/jaxme/junit/AntlrTest.java	4 Aug 2005 12:08:22 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2003, 2004  The Apache Software Foundation
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- */
-package org.apache.ws.jaxme.js.junit;
-
-import junit.framework.TestCase;
-
-/**
- * Test for JavaParser.
- */
-public class AntlrTest extends TestCase {
-
-	/**
-	 * Tests the JavaParser.
-	 */
-	public void test() throws Throwable {
-		final String path = System.getProperty("js.src")
-			+ "/org/apache/ws/jaxme/sqls/impl/SQLGeneratorImpl.java";
-		org.apache.ws.jaxme.js.util.JavaParser.main(new String[]{path});
-	}
-	
-}
Index: src/jaxme/org/apache/ws/jaxme/junit/JiraTest.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/junit/JiraTest.java,v
retrieving revision 1.9
diff -u -r1.9 JiraTest.java
--- src/jaxme/org/apache/ws/jaxme/junit/JiraTest.java	30 Jul 2005 21:05:15 -0000	1.9
+++ src/jaxme/org/apache/ws/jaxme/junit/JiraTest.java	4 Aug 2005 21:28:16 -0000
@@ -26,6 +26,7 @@
 import org.apache.ws.jaxme.test.misc.types.impl.RowImpl;
 import org.apache.ws.jaxme.test.misc.xsimport.a.Outer;
 import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 
 /** Some excerpts from Jira bug reports.
@@ -187,7 +188,6 @@
 			xml += (char) ('0' + j);
 		}
 		xml += "'/>";
-		System.out.println("Parsing " + xml);
 		InputSource isource = new InputSource(new StringReader(xml));
 		isource.setSystemId("testJAXME62-a-" + i + ".xsd");
 		EventDetector ed = new EventDetector();
@@ -196,4 +196,38 @@
 		u.unmarshal(isource);
 		assertEquals(pSuccess, ed.isSuccess());
 	}
+
+	/** Test for <a href="http://issues.apache.org/jira/browse/JAXME-63">JAXME-63</a>.
+	 */
+	public void testJAXME63() throws Exception {
+		final String xml =
+			"<xs:schema\n"
+			+ "    xmlns:xs='http://www.w3.org/2001/XMLSchema'\n"
+			+ "    elementFormDefault='qualified'>\n"
+			+ "  <xs:group name='params'>\n"
+			+ "    <xs:choice>\n"
+			+ "      <xs:element name='string' type='xs:string'/>\n"
+			+ "      <xs:element name='int' type='xs:int'/>\n"
+			+ "      <xs:element name='boolean' type='xs:boolean'/>\n"
+			+ "    </xs:choice>\n"
+			+ "  </xs:group>\n"
+			+ "  <xs:element name='call'>\n"
+			+ "    <xs:complexType>\n"
+			+ "      <xs:group ref='params' maxOccurs='unbounded'/>\n"
+			+ "    </xs:complexType>\n"
+			+ "  </xs:element>\n"
+			+ "</xs:schema>";
+		Generator g = new GeneratorImpl();
+		g.setProperty("jaxme.package.name", "org.apache.ws.jaxme.test.jira.jaxme63");
+		SchemaReader sr = new JAXBSchemaReader();
+		g.setSchemaReader(sr);
+		sr.setGenerator(g);
+		SchemaSG schema = g.getSchemaReader().parse(new InputSource(new StringReader(xml)));
+		try {
+			schema.generate();
+			fail("Expected exception");
+		} catch (SAXException e) {
+			assertTrue(e.getMessage().indexOf("Model groups with maxOccurs > 1 are not yet supported.") != -1);
+		}
+	}
 }
Index: src/xs/org/apache/ws/jaxme/xs/impl/XSTypeImpl.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/impl/XSTypeImpl.java,v
retrieving revision 1.18
diff -u -r1.18 XSTypeImpl.java
--- src/xs/org/apache/ws/jaxme/xs/impl/XSTypeImpl.java	19 May 2005 20:30:33 -0000	1.18
+++ src/xs/org/apache/ws/jaxme/xs/impl/XSTypeImpl.java	4 Aug 2005 21:28:20 -0000
@@ -455,10 +455,13 @@
   public class XSGroupComplexTypeImpl extends XSBasicComplexTypeImpl {
     private final XSGroup group;
 
-    public XSGroupComplexTypeImpl(XSType pOwner, XsTComplexType pType, XSGroup pGroup) throws SAXException {
+    public XSGroupComplexTypeImpl(XSType pOwner, XsTComplexType pType, XSGroup pGroup,
+    							  XsTGroupRef pRef) throws SAXException {
       super(pOwner, pType);
       group = pGroup;
       XSParticleImpl particle = new XSParticleImpl(group);
+      particle.setMinOccurs(pRef.getMinOccurs());
+      particle.setMaxOccurs(pRef.getMaxOccurs());
       if (group.getParticles().length == 0) {
         setParticle(XsComplexContentType.EMPTY, particle);
       } else {
@@ -711,7 +714,7 @@
               throw new LocSAXException("Unknown group: " + myName, getLocator());
             }
             group.validate();
-            myComplexType = new XSGroupComplexTypeImpl(this, myXsTComplexType, group);
+            myComplexType = new XSGroupComplexTypeImpl(this, myXsTComplexType, group, groupRef);
           } else {
             throw new IllegalStateException("Invalid particle: " + particle.getClass().getName());
           }
Index: src/xs/org/apache/ws/jaxme/xs/junit/JiraTest.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/JiraTest.java,v
retrieving revision 1.4
diff -u -r1.4 JiraTest.java
--- src/xs/org/apache/ws/jaxme/xs/junit/JiraTest.java	4 Dec 2004 23:22:33 -0000	1.4
+++ src/xs/org/apache/ws/jaxme/xs/junit/JiraTest.java	4 Aug 2005 21:28:21 -0000
@@ -13,6 +13,7 @@
 import org.apache.ws.jaxme.xs.XSElement;
 import org.apache.ws.jaxme.xs.XSEnumeration;
 import org.apache.ws.jaxme.xs.XSParser;
+import org.apache.ws.jaxme.xs.XSParticle;
 import org.apache.ws.jaxme.xs.XSSchema;
 import org.apache.ws.jaxme.xs.XSSimpleContentType;
 import org.apache.ws.jaxme.xs.XSSimpleType;
@@ -170,4 +171,37 @@
         assertEquals(XSID.getInstance(), idAttr.getType());
         assertFalse(idRef.isOptional());
     }
+
+	/** Test for <a href="http://issues.apache.org/jira/browse/JAXME-63">JAXME-63</a>.
+	 */
+	public void testJAXME63() throws Exception {
+		final String xml =
+			"<xs:schema\n"
+			+ "    xmlns:xs='http://www.w3.org/2001/XMLSchema'\n"
+			+ "    elementFormDefault='qualified'>\n"
+			+ "  <xs:group name='params'>\n"
+			+ "    <xs:choice>\n"
+			+ "      <xs:element name='string' type='xs:string'/>\n"
+			+ "      <xs:element name='int' type='xs:int'/>\n"
+			+ "      <xs:element name='boolean' type='xs:boolean'/>\n"
+			+ "    </xs:choice>\n"
+			+ "  </xs:group>\n"
+			+ "  <xs:element name='call'>\n"
+			+ "    <xs:complexType>\n"
+			+ "      <xs:group ref='params' maxOccurs='unbounded'/>\n"
+			+ "    </xs:complexType>\n"
+			+ "  </xs:element>\n"
+			+ "</xs:schema>";
+        XSSchema schema = parse(xml, "jaxme63.xsd");
+        XSElement[] elements = schema.getElements();
+        assertEquals(1, elements.length);
+        XSElement call = elements[0];
+        assertEquals(new XsQName((String) null, "call"), call.getName());
+        XSComplexType type = assertComplexType(call.getType());
+        XSParticle particle = assertComplexContent(type);
+        assertTrue(particle.isGroup());
+        assertChoice(particle.getGroup());
+        assertEquals(1, particle.getMinOccurs());
+        assertEquals(-1, particle.getMaxOccurs());
+	}
 }
Index: src/js/org/apache/ws/jaxme/js/junit/AntlrTest.java
===================================================================
RCS file: src/js/org/apache/ws/jaxme/js/junit/AntlrTest.java
diff -N src/js/org/apache/ws/jaxme/js/junit/AntlrTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/js/org/apache/ws/jaxme/js/junit/AntlrTest.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2003, 2004  The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+
+ */
+package org.apache.ws.jaxme.js.junit;
+
+import junit.framework.TestCase;
+
+/**
+ * Test for JavaParser.
+ */
+public class AntlrTest extends TestCase {
+
+	/**
+	 * Tests the JavaParser.
+	 */
+	public void test() throws Throwable {
+		final String path = System.getProperty("js.src")
+			+ "/org/apache/ws/jaxme/sqls/impl/SQLGeneratorImpl.java";
+		org.apache.ws.jaxme.js.util.JavaParser.main(new String[]{path});
+	}
+	
+}
