*/
public void testAnnotations() {
XSModel model = fSchemaLoader
.loadURI(getResourceURL("XSAttributeAnnotationsTest02.xsd"));
XSAttributeDeclaration attr = model.getAttributeDeclaration("attr",
"XSAttributeAnnotationsTest");
XSObjectList annotations = attr.getAnnotations();
String expectedResult = "<annotation id=\"ANNOT1\" "
+ "xmlns=\"http://www.w3.org/2001/XMLSchema\" "
+ "xmlns:sv=\"XSAttributeAnnotationsTest\" >"
+ "<appinfo source=\"None\">"
+ "<!-- No Appinfo -->"
+ "</appinfo><documentation>ANNOT1 should be seen</documentation>"
+ "</annotation>";
for (int i = 0; i < annotations.getLength(); i++) {
XSAnnotation annotation = (XSAnnotation) annotations.item(i);
String actual = annotation.getAnnotationString();
assertEquals(trim(expectedResult), trim(actual));
}
attr = model.getAttributeDeclaration("attr2",
"XSAttributeAnnotationsTest");
annotations = attr.getAnnotations();
expectedResult = "<annotation id=\"ANNOT2\" "
+ "xmlns=\"http://www.w3.org/2001/XMLSchema\" "
+ "xmlns:sv=\"XSAttributeAnnotationsTest\" >" + "</annotation>";