XSElementDeclaration elem1 = model.getElementDeclaration("elem2",
"XSParticleTest");
XSComplexTypeDefinition ct = (XSComplexTypeDefinition) elem1
.getTypeDefinition();
XSParticle sequence = ct.getParticle();
XSModelGroup sequencegrp = (XSModelGroup) sequence.getTerm();
XSParticle elem2 = (XSParticle) sequencegrp.getParticles().item(0);
XSElementDeclaration elemDecl2 = (XSElementDeclaration) elem2.getTerm();
XSObjectList annotations = elem2.getAnnotations();
assertEquals(
"TEST6_ANNOTATIONS_1_" + synth,
expected,
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
annotations = elemDecl2.getAnnotations();
assertEquals(
"TEST6_ANNOTATIONS_2_" + synth,
expected2,
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
if (synth.booleanValue() == true) {
XSParticle elem3 = (XSParticle) sequencegrp.getParticles().item(1);
XSElementDeclaration elemDecl3 = (XSElementDeclaration) elem3
.getTerm();
annotations = elem3.getAnnotations();
assertEquals("TEST6_ANNOTATIONS_3_" + synth, 0, annotations
.getLength());
annotations = elemDecl3.getAnnotations();
assertEquals("TEST6_ANNOTATIONS_4_" + synth, expected3,
trim(((XSAnnotation) annotations.item(0))
.getAnnotationString()));
}
XSParticle elem3 = (XSParticle) sequencegrp.getParticles().item(2);
XSElementDeclaration elemDecl3 = (XSElementDeclaration) elem3.getTerm();
annotations = elem3.getAnnotations();
assertEquals(
"TEST6_ANNOTATIONS_1_" + synth,
expected4,
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
annotations = elemDecl3.getAnnotations();
assertEquals(
"TEST6_ANNOTATIONS_2_" + synth,
expected5,
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
if (synth.booleanValue() == true) {
XSParticle elem4 = (XSParticle) sequencegrp.getParticles().item(3);
XSElementDeclaration elemDecl4 = (XSElementDeclaration) elem4
.getTerm();
annotations = elem4.getAnnotations();
assertEquals("TEST6_ANNOTATIONS_3_" + synth, 1, annotations
.getLength());
annotations = elemDecl4.getAnnotations();
assertEquals("TEST6_ANNOTATIONS_4_" + synth, expected6,
trim(((XSAnnotation) annotations.item(0))
.getAnnotationString()));
}
XSParticle any = (XSParticle) sequencegrp.getParticles().item(4);
annotations = any.getAnnotations();
assertEquals(
"TEST6_ANNOTATIONS_1_" + synth,
expected7,
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));