0 Replies Latest reply on Oct 7, 2013 9:47 AM by Johan Evelönn

    Problem with arquillian-extension-spring

    Johan Evelönn Newbie

      Hi, I'm using arquillian-extension-spring to run arquillian tests with spring support.

       

      The problem I have is that my @Autowired components in the test is null when running the test.

       

      My setup is:

       

      I work in a large project with multiple maven projects. My test is in a separate maven project and it contains dependencies towards multiple projects.

       

      In my deployment I read all the test dependencies from my pom.xml and build an EAR file containing the dependencies and also adding a JAR (to the EAR) with the testcase and some test dependencies.

       

      My @SpringConfiguration contains our own ClassPathXmlApplicationContext (doesn't work with Spring default either) which simply puts all beans to lazyInit = true. I also have a bunch of contexts that should be loaded.

       

      I can see in the log that the spring context is setup, I get a lot of "Loading XML bean definitions from class path resource" and from what I can tell all the contexts that I wan't to be loaded are loaded.

       

      The version I use is:

      <dependency>

         <groupId>org.jboss.arquillian.extension</groupId>

         <artifactId>arquillian-service-integration-spring-inject</artifactId>

         <version>1.0.0.Beta2</version>

         <scope>test</scope>

      </dependency>

       

      Best Regards

      Johan