0 Replies Latest reply on Dec 19, 2016 1:38 PM by rameshn30

    Spring

    rameshn30

      Hello All,I have a spring based web app for which I've added an integration test case based on Arquillian.

       

      I have a spring based web app for which I've added an integration test case based on Arquillian.

      The project setup if working fine and test is also getting executed.

      It uses arquillian-service-integration-spring-inject, arquillian-tomcat-embedded-7.

       

       

      @RunWith(Arquillian.class)

      @SpringConfiguration({ "spring-servlet.xml" })

      public class EmployeeServiceTest {

       

       

        @Autowired

        EmployeeService empService;

       

      @Deployment

        public static Archive createDeployment() {

       

       

        return ShrinkWrap.create(JavaArchive.class,"spring-test.jar");

                    .addPackages(true, "com.howtodoinjava");

        .addAsResource("spring-servlet.xml", "spring-servlet.xml");

        }

       

      I see tomcat starting up , in my console . EmployeeService is getting properly autowired.

      My question is , does this really run inside the container? Somehow it feels like its running

      based on just the spring autowiring, just like a usual SpringJUnitTest would do.

       

       

      @Deployment

        public static Archive createDeployment() {

       

       

        JavaArchive jar=ShrinkWrap.create(JavaArchive.class,"spring-test.jar");

       

        System.out.println(jar.toString());

       

        return jar;

        }

       

        Even if the createDeployment returns an empty jar, my tests will work. The service object is injected.

        Have I really performed an Arquillian test ? How is it different than Spring. What's the role of the tomcat

        embedded container , when the archive itself is empty.

       

        Thanks for your help