-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.0.0.Final, 1.0.1.Final
-
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()); } }