Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1020

Arquillian doesnt set ThreadLocalClassLoader to the @Deployment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.0.Final, 1.0.1.Final
    • Base Implementation
    • None

      Arquillian doesn't set the ThreadLocalClassLoader to the @Deployment archive. This leads to getResources() calls not finding any deployed resources.

      The following code fragment from Apache DeltaSpike should make clear what I mean:

      @RunWith(Arquillian.class)
      public class PropertyConfigSourceTest
      {
          @Deployment
          public static WebArchive deploy()
          {
              return ShrinkWrap.create(WebArchive.class, "beanProvider.war")
                      .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
                      .addAsResource(new StringAsset("prop=value"), "myconfig.properties")
                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
          }
      
      
          @Test
          public void testCustomPropertyConfigSources() throws Exception
          {
              Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources("myconfig.properties");
              // kawumms...
              Assert.assertTrue(resources.hasMoreElements());
          }
      
      }
      
      

            Unassigned Unassigned
            struberg Mark Struberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: