### Question:
EnumType extends AegisType { @Override public void writeSchema(XmlSchema root) { XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true); simple.setName(getSchemaType().getLocalPart()); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING); simple.setContent(restriction); Object[] constants = getTypeClass().getEnumConstants(); List<XmlSchemaFacet> facets = restriction.getFacets(); for (Object constant : constants) { XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet(); f.setValue(getValue(constant)); facets.add(f); } }  @Override Object readObject(MessageReader reader, Context context); @Override void writeObject(Object object, MessageWriter writer, Context context); @Override void setTypeClass(Type typeClass); @Override void writeSchema(XmlSchema root); @Override boolean isComplex();  }### Answer:
@Test public void testWsdlFromJaxbAnnotations() throws Exception { AegisType type = tm.getTypeCreator().createType(JaxbTestEnum.class); XmlSchema schema = newXmlSchema("urn:test"); type.writeSchema(schema); XmlSchemaSerializer ser = new XmlSchemaSerializer(); Document doc = ser.serializeSchema(schema, false)[0]; addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD); assertValid(" assertValid(" assertValid(" }