Package org.jboss.weld.integration.deployer.env

Examples of org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment


      // must wrap in WeakReference because value refers strongly to its own key
      // see WeakHashMap javadoc
      instances.put(classLoader, new WeakReference<ArchiveInfo>(this));
      this.classLoader = classLoader;
      this.classpath = classpathFactory.create(classLoader);
      this.environment = new WeldDiscoveryEnvironment();
      this.ejbNames = ejbNames;
   }
View Full Code Here


                  BeanDeploymentArchive bda = archive.createBeanDeploymentArchive(NoopServiceRegistry.INSTANCE);
                  if (bda != null)
                     libs.add(archive);

                  // the env
                  WeldDiscoveryEnvironment environment = archiveInfo.getEnvironment();
                  // fill in the Weld classes
                  // the WBDiscoveryVisitor from ArchiveDiscoveryDeployer...
                  ResourceVisitor visitor = environment.visitor();
                  Module module = entry.getKey();

                  for (VirtualFile child : files)
                  {
                     URL beansXmlURL = child.getChild(provider.getResourceName()).toURL();
                     environment.addWeldXmlURL(beansXmlURL);

                     module.visit(visitor, ClassFilter.INSTANCE, null, child.toURL());
                  }
               }
            }
View Full Code Here

   {
      VirtualFile ear = createBasicEar();
      VFSDeploymentUnit topUnit = assertDeploy(ear);
      try
      {
         WeldDiscoveryEnvironment wbDiscovery = topUnit.getAttachment(WeldDiscoveryEnvironment.class);
         assertNotNull("Null WBDiscoveryEnv.", wbDiscovery);

         Set<String> expected = new HashSet<String>();
         addExpectedResource(expected, "ejbs.jar");
         addExpectedResource(expected, "ext.jar");
         addExpectedResource(expected, "simple.jar");
         addExpectedResource(expected, "ui.jar");
         addExpectedResource(expected, "crm.jar");
         addExpectedResource(expected, "simple.war", "/WEB-INF/beans.xml");

         assertNotNull(wbDiscovery);

         for (URL url : wbDiscovery.getWeldXml())
         {
            boolean found = false;
            Iterator<String> iter = expected.iterator();
            while (iter.hasNext())
            {
               String expectedURL = iter.next();
               if (url.toExternalForm().contains(expectedURL))
               {
                  iter.remove();
                  found = true;
                  break;
               }
            }
            assertTrue("Unexpected wb url: " + url, found);
         }

         assertEmpty("Should be emtpy, missing " + expected, expected);

         addExpectedClass(expected, BusinessInterface.class);
         addExpectedClass(expected, MySLSBean.class);
         addExpectedClass(expected, ExternalWebBean.class);
         addExpectedClass(expected, PlainJavaBean.class);
         addExpectedClass(expected, UIWebBean.class);
         addExpectedClass(expected, ServletWebBean.class);
         addExpectedClass(expected, CrmWebBean.class);

         for (String className : wbDiscovery.getWeldClasses())
            assertTrue(expected.remove(className));

         assertEmpty("Should be emtpy, missing " + expected, expected);
      }
      finally
View Full Code Here

   }

   @Override
   protected void assertWarsInEar()
   {
      WeldDiscoveryEnvironment discovery = assertDiscoveryEnvironment();
      assertExpectedClasses(discovery);
      assertExpectedResources(discovery);
     
      for (DeploymentUnit childUnit: unit.getChildren())
      {
View Full Code Here

   }

   @Override
   protected void assertBasicEar()
   {
      WeldDiscoveryEnvironment discovery = assertDiscoveryEnvironment();
      assertExpectedClasses(discovery, BusinessInterface.class, MySLSBean.class,
               ExternalWebBean.class, PlainJavaBean.class);
      assertExpectedResources(discovery, "top-level.ear/ejbs.jar",
               "top-level.ear/lib/ext.jar", "top-level.ear/simple.jar");
View Full Code Here

   }

   @Override
   protected void assertBasicEarFullCDI()
   {
      WeldDiscoveryEnvironment discovery = assertDiscoveryEnvironment();
      assertExpectedClasses(discovery, BusinessInterface.class, MySLSBean.class,
               ExternalWebBean.class, PlainJavaBean.class, SomeUtil.class);
      assertExpectedResources(discovery, "top-level.ear/lib/util.jar",
               "top-level.ear/lib/ext.jar", "top-level.ear/simple.jar",
               "top-level.ear/ejbs.jar");
View Full Code Here

   }

   @Override
   protected void assertBasicEarWithoutXml()
   {
      WeldDiscoveryEnvironment discovery = assertDiscoveryEnvironment();
     
      assertExpectedClasses(discovery);
      assertExpectedResources(discovery);

      for (DeploymentUnit childUnit: unit.getChildren())
View Full Code Here

   }

   @Override
   protected void assertEmptyEnvironment()
   {
      WeldDiscoveryEnvironment discovery = assertDiscoveryEnvironment();
      assertExpectedClasses(discovery);
      assertExpectedResources(discovery);
   }
View Full Code Here

   {
      ArchiveInfo archiveInfo = unit.getAttachment(ArchiveInfo.class);
      assertNotNull(archiveInfo);
      assertTrue("Unit name \"" + unit.getName() + "\" expected to end with \"" + name +
               "\" suffix", unit.getName().endsWith(name + '/'));
      WeldDiscoveryEnvironment discovery = archiveInfo.getEnvironment();
      assertNotNull(discovery);
      return discovery;
   }
View Full Code Here

   private WeldDiscoveryEnvironment assertDiscoveryEnvironment()
   {
      ArchiveInfo archiveInfo = unit.getAttachment(ArchiveInfo.class);
      assertNotNull(archiveInfo);
      WeldDiscoveryEnvironment discovery = archiveInfo.getEnvironment();
      assertNotNull(discovery);
      return discovery;
   }
View Full Code Here

TOP

Related Classes of org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment

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.