Package org.jboss.metadata.javaee.jboss

Examples of org.jboss.metadata.javaee.jboss.AnnotationMetaData


      JBossSessionBeanMetaData original = new JBossSessionBeanMetaData();
      original.setEjbName("session");

      AnnotationsMetaData annotations = new AnnotationsMetaData();
      original.setAnnotations(annotations);
      AnnotationMetaData annotation = new AnnotationMetaData();
      annotation.setAnnotationClass("annotation1");
      annotation.setAnnotationImplementationClass(annotation.getAnnotationClass() + "Original");
      annotations.add(annotation);
      annotation = new AnnotationMetaData();
      annotation.setAnnotationClass("annotation2");
      annotation.setAnnotationImplementationClass(annotation.getAnnotationClass() + "Original");
      annotations.add(annotation);
     
      JBossSessionBeanMetaData override = new JBossSessionBeanMetaData();
      override.setEjbName("session");
      annotations = new AnnotationsMetaData();
      override.setAnnotations(annotations);
      annotation = new AnnotationMetaData();
      annotation.setAnnotationClass("annotation2");
      annotation.setAnnotationImplementationClass(annotation.getAnnotationClass() + "Override");
      annotations.add(annotation);
      annotation = new AnnotationMetaData();
      annotation.setAnnotationClass("annotation3");
      annotation.setAnnotationImplementationClass(annotation.getAnnotationClass() + "Override");
      annotations.add(annotation);
     
      JBossSessionBeanMetaData merged = new JBossSessionBeanMetaData();
      merged.merge(override, original);
      annotations = merged.getAnnotations();
      assertNotNull(annotations);
      assertEquals(3, annotations.size());
      annotation = annotations.get("annotation1");
      assertNotNull(annotation);
      assertEquals(annotation.getAnnotationClass() + "Original", annotation.getAnnotationImplementationClass());
      annotation = annotations.get("annotation2");
      assertNotNull(annotation);
      assertEquals(annotation.getAnnotationClass() + "Override", annotation.getAnnotationImplementationClass());
      annotation = annotations.get("annotation3");
      assertNotNull(annotation);
      assertEquals(annotation.getAnnotationClass() + "Override", annotation.getAnnotationImplementationClass());
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.jboss.AnnotationMetaData

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.