0 Replies Latest reply on Aug 24, 2012 10:25 AM by Kresimir Duretec

    A problem when accessing the resources

    Kresimir Duretec Newbie

       

      Hi all ,

       

      I am using Arquillian to develop integration tests for a project that I am currently working on.  So far it went ok but now I am stuck with one problem. The problem is that a piece of code that I am trying to test is accessing some resources (which are in  src/main/resources).

       

      This project is a multimodule maven project and everything is packaged in an EAR.

      For a test deployment I assemble an EAR from WARs and do some minor modifications like adding the test class into the right WAR and deleting some stuff. I know this maybe isn't the best way to do it but it was the most convenient for me. I am using JBoss AS 7 (7.1.0) as a server.

       

      Needed resources are also in their place. Basically it is a directory that contains some files which need to be loaded. That directory is accessed by

      URL url = Thread.currentThread().getContextClassLoader().getResource(directory);

       

      When the files need to be loaded they are not loaded. The reason for this is probably the fact that the whole deployment is an archive file so the resources can't be accessed (right?).

       

      So my questions are

       

      1. Is there a way to say to Arquillian/ShrinkWrap to deploy the archive as an exploded archive? I think that could solve the problem. According to this issue https://issues.jboss.org/browse/ARQ-315 currently it is not possible but maybe I am missing something.
      2. Is there any other way how to access resources? Any recommendation is most welcomed. 

       

      I understand that without code it is hard to tell what is the problem so if needed I can create a small project to demonstrate the problem.

       

       

      Thanks for your help

      Kresimir