assertNotNull(xsct);
XmlSchemaSimpleContent xssc = (XmlSchemaSimpleContent)xsct.getContentModel();
assertNotNull(xssc);
XmlSchemaSimpleContentRestriction xsscr
= (XmlSchemaSimpleContentRestriction)xssc.getContent();
assertNotNull(xsscr);
assertEquals(new QName("http://soapinterop.org/types", "drinksize"),
xsscr.getBaseTypeName());
XmlSchemaObjectCollection xsoc = xsscr.getAttributes();
assertNotNull(xsoc);
assertEquals(2, xsoc.getCount());
Set s = new HashSet();
s.add("units");
s.add("id");
for (int i = 0; i < xsoc.getCount(); i++) {
XmlSchemaAttribute xsa = (XmlSchemaAttribute)xsoc.getItem(i);
String name = xsa.getName();
if (name.equals("units")) {
assertEquals(new QName("http://soapinterop.org/types", "units"),
xsa.getQName());
assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
xsa.getSchemaTypeName());
assertNull(xsa.getDefaultValue());
assertEquals("required", xsa.getUse().getValue());
assertNull(xsa.getFixedValue());
} else if (name.equals("id")) {
assertEquals(new QName("http://soapinterop.org/types", "id"),
xsa.getQName());
assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "integer"),
xsa.getSchemaTypeName());
assertEquals("001", xsa.getDefaultValue());
assertEquals("required", xsa.getUse().getValue());
assertNull(xsa.getFixedValue());
} else {
fail("The name \"" + name + "\" was not expected.");
}
assertTrue(s.remove(name));
}
assertTrue("The set should have been empty, but instead contained: "
+ s + ".",
s.isEmpty());
XmlSchemaObjectCollection xsoc2 = xsscr.getFacets();
assertNotNull(xsoc2);
assertEquals(2, xsoc2.getCount());
s.clear();
s.add("small");