Author: bimargulies Date: Mon Oct 11 16:59:48 2010 New Revision: 1021427 URL: http://svn.apache.org/viewvc?rev=1021427&view=rev Log: fix simple content restriction to store list of more descriptive type
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SimpleContentRestrictionTest.java Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java?rev=1021427&r1=1021426&r2=1021427&view=diff ============================================================================== --- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java (original) +++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java Mon Oct 11 16:59:48 2010 @@ -37,7 +37,7 @@ public class XmlSchemaSimpleContentRestr * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple * type. */ - private List<XmlSchemaAnnotated> attributes; + private List<XmlSchemaAttributeOrGroupRef> attributes; /* Derived from the type specified by the base value. */ private XmlSchemaSimpleType baseType; @@ -55,7 +55,7 @@ public class XmlSchemaSimpleContentRestr */ public XmlSchemaSimpleContentRestriction() { facets = Collections.synchronizedList(new ArrayList<XmlSchemaFacet>()); - attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAnnotated>()); + attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); } /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ @@ -68,7 +68,7 @@ public class XmlSchemaSimpleContentRestr return this.anyAttribute; } - public List<XmlSchemaAnnotated> getAttributes() { + public List<XmlSchemaAttributeOrGroupRef> getAttributes() { return this.attributes; } Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SimpleContentRestrictionTest.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SimpleContentRestrictionTest.java?rev=1021427&r1=1021426&r2=1021427&view=diff ============================================================================== --- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SimpleContentRestrictionTest.java (original) +++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SimpleContentRestrictionTest.java Mon Oct 11 16:59:48 2010 @@ -29,8 +29,8 @@ import javax.xml.namespace.QName; import javax.xml.transform.stream.StreamSource; import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaAnnotated; import org.apache.ws.commons.schema.XmlSchemaAttribute; +import org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef; import org.apache.ws.commons.schema.XmlSchemaCollection; import org.apache.ws.commons.schema.XmlSchemaComplexType; import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; @@ -62,7 +62,7 @@ public class SimpleContentRestrictionTes /** * This method will test the simple content restriction. - * + * * @throws Exception Any exception encountered */ @Test @@ -93,7 +93,7 @@ public class SimpleContentRestrictionTes XmlSchemaSimpleContentRestriction xsscr = (XmlSchemaSimpleContentRestriction)xssc.getContent(); assertNotNull(xsscr); assertEquals(new QName("http://soapinterop.org/types", "drinksize"), xsscr.getBaseTypeName()); - List<XmlSchemaAnnotated> xsoc = xsscr.getAttributes(); + List<XmlSchemaAttributeOrGroupRef> xsoc = xsscr.getAttributes(); assertNotNull(xsoc); assertEquals(2, xsoc.size()); @@ -105,7 +105,7 @@ public class SimpleContentRestrictionTes String name = xsa.getName(); if ("units".equals(name)) { assertEquals(new QName("http://soapinterop.org/types", "units"), xsa.getQName()); - assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"), + assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"), xsa.getSchemaTypeName()); assertNull(xsa.getDefaultValue()); assertEquals("required", xsa.getUse().toString());