Package net.riccardocossu.autodoc.base

Examples of net.riccardocossu.autodoc.base.AnnotationModel


  @Test
  public void testSimple() {
    JPAPlugin pl = new JPAPlugin();
    Annotation[] annotations = SimpleTestEntity.class.getAnnotations();
    for (Annotation a : annotations) {
      AnnotationModel res = pl.parse(a);
      assertNotNull(res);
    }
  }
View Full Code Here


  public void testNested() {
    JPAPlugin pl = new JPAPlugin();
    Annotation[] annotations = NestedQueryTestEntity.class.getAnnotations();
    for (Annotation a : annotations) {
      if (a instanceof NamedQueries) {
        AnnotationModel res = pl.parse(a);
        assertNotNull(res);
        assertEquals(1, res.getAttributes().size());
        assertNull(res.getChildren());
        AttributeModel nq = res.getAttributes().get(0);
        assertEquals("value", nq.getName());
        assertTrue(nq.getValue() instanceof AnnotationModel);
        AnnotationModel am = (AnnotationModel) nq.getValue();
        assertEquals(0, am.getAttributes().size());
        List<AnnotationModel> children = am.getChildren();
        assertEquals(1, children.size());
        AnnotationModel firstNq = children.get(0);
        assertEquals(4, firstNq.getAttributes().size());
        AnnotationModel amHA = (AnnotationModel) firstNq
            .getAttributes().get(2).getValue();
        assertEquals(QueryHint.class.getName() + "[]",
            amHA.getQualifiedName());
        List<AnnotationModel> amHACh = amHA.getChildren();
        assertEquals(2, amHACh.get(0).getAttributes().size());
      }

    }
  }
View Full Code Here

   * net.riccardocossu.autodoc.base.AnnotationsPlugin#parse(java.lang.annotation
   * .Annotation)
   */
  @Override
  public AnnotationModel parse(Annotation target) {
    AnnotationModel am = new AnnotationModel();
    am.setQualifiedName(MXBean.class.getName());
    return am;
  }
View Full Code Here

TOP

Related Classes of net.riccardocossu.autodoc.base.AnnotationModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.