Package org.jboss.metadata.annotation.creator.web

Examples of org.jboss.metadata.annotation.creator.web.Web25MetaDataCreator


  
   @ScanPackage("org.jboss.test.metadata.annotation.web.injection")
   public void testInjectionTargets()
   {
      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
      Collection<Class<?>> classes = PackageScanner.loadClasses();
     
      WebMetaData metaData = creator.create(classes);
     
      assertNotNull(metaData);
      // @Ejb
      AnnotatedEJBReferencesMetaData annotatedRefs = metaData.getAnnotatedEjbReferences();
      assertNotNull(annotatedRefs);
View Full Code Here


      {MyServlet.class};
      List<Class<?>> classes = Arrays.asList(webClasses);
      System.out.println("Processing classes: " + classes);

      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
      Web25MetaData metaData = creator.create(classes);

      WebMetaData specMetaData = new Web25MetaData();
      WebMetaData merged = new Web25MetaData();
      AnnotationMergedView.merge(merged, specMetaData, metaData);
View Full Code Here

      {MyServlet.class};
      List<Class<?>> classes = Arrays.asList(webClasses);
      System.out.println("Processing classes: " + classes);

      //enableTrace("org.jboss.metadata.annotation.creator");
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);

      Web25MetaData metaData = creator.create(classes);

      assertTrue(metaData.is25());
      assertEquals("2.5", metaData.getVersion());

      assertEnv(metaData.getJndiEnvironmentRefsGroup());
View Full Code Here

      {MyServlet.class};
      List<Class<?>> classes = Arrays.asList(webClasses);
      System.out.println("Processing classes: " + classes);

      //enableTrace("org.jboss.metadata.annotation.creator");
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);

      Web25MetaData annotation = creator.create(classes);

      assertTrue(annotation.is25());

      //Now create the web meta data
      WebMetaData xml = unmarshal(WebMetaData.class);
View Full Code Here

      {MyServlet.class};
      List<Class<?>> classes = Arrays.asList(webClasses);
      System.out.println("Processing classes: " + classes);

      //enableTrace("org.jboss.metadata.annotation.creator");
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);

      Web25MetaData annotation = creator.create(classes);

      assertTrue(annotation.is25());

      //Now create the web meta data
      WebMetaData xml = unmarshal("AnnotationWeb_testAnnotationXML.xml", WebMetaData.class);

      //Create the JBossWebMetaData
      JBossWebMetaData jbossWMD = unmarshal("JBossWeb_testAnnotationXML.xml", JBossWebMetaData.class);

      //Let us merge the merged spec metadata with the jbossweb metadata
      JBossWebMetaData mergedJBossWebMD = new JBossWebMetaData();
      mergedJBossWebMD.merge(jbossWMD, xml);

      //Assert the run as role
      assertTrue(mergedJBossWebMD.getRunAsIdentity("MyServlet").getRoleName().startsWith("PLACEHOLDER"));

      WebMetaData merged = new WebMetaData();
      //Merge the annotation and xml
      AnnotationMergedView.merge(merged, xml, annotation);

      JBossWebMetaData newMerged = new JBossWebMetaData();
      newMerged.merge(mergedJBossWebMD, merged);

      //Assert the run as role
      JBossServletMetaData jbossServletMetaData = newMerged.getServlets().get("MyServlet");
      assertEquals("InternalUser", jbossServletMetaData.getRunAs().getRoleName());
      assertEquals("javajoe", jbossServletMetaData.getRunAsPrincipal());

      // @PostConstruct
      assertEquals("setUp", merged.getPostConstructs().get(0).getMethodName());
      // @PreDestroy
      assertEquals("tearDown", merged.getPreDestroys().get(0).getMethodName());

      assertAnnotationContext(creator.getAnnotationContext());
   }
View Full Code Here

      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
      Class<?>[] webClasses = {SimpleServlet.class, MyServlet.class};
      List<Class<?>> classes = Arrays.asList(webClasses);

      //enableTrace("org.jboss.metadata.annotation.creator");
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);

      Web25MetaData annotation = creator.create(classes);

      assertTrue(annotation.is25());
      EnvironmentRefsGroupMetaData envRefs = annotation.getJndiEnvironmentRefsGroup();
      assertNotNull(envRefs);
View Full Code Here

    * @param classes the candidate classes
    */
   protected void processJBossWebMetaData(VFSDeploymentUnit unit,
         AnnotationFinder<AnnotatedElement> finder, Collection<Class<?>> classes)
   {
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
      WebMetaData annotationMetaData = creator.create(classes);
      if(annotationMetaData != null)
         unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME, annotationMetaData, WebMetaData.class);
   }
View Full Code Here

    * @param unit the deployment unit
    * @param finder the finder
    */
   protected void processJBossWebMetaData(VFSDeploymentUnit unit, AnnotationFinder<AnnotatedElement> finder)
   {
      Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
      Collection<Class<?>> classes = getClasses(unit, creator);
      WebMetaData annotationMetaData = creator.create(classes);
      if(annotationMetaData != null)
         unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME, annotationMetaData, WebMetaData.class);
   }
View Full Code Here

/* 196 */       unit.addAttachment(EJB_ANNOTATED_ATTACHMENT_NAME, annotationMetaData, EjbJarMetaData.class);
/*     */   }
/*     */
/*     */   protected void processJBossWebMetaData(VFSDeploymentUnit unit, AnnotationFinder<AnnotatedElement> finder, Map<VirtualFile, Class<?>> classes)
/*     */   {
/* 201 */     Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
/* 202 */     Web25MetaData annotationMetaData = creator.create(classes.values());
/* 203 */     if (annotationMetaData != null)
/* 204 */       unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME, annotationMetaData, WebMetaData.class);
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.annotation.creator.web.Web25MetaDataCreator

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.