2 Replies Latest reply on Oct 13, 2014 8:51 AM by Bartosz Majsak

    Wildfly+Spring : ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

    Shrikant Havale Newbie

      Hello All,

       

      I am working on a project, where in I am trying to use Arquillian for integration testing. Our project is using Spring 4, Hibernate and we are trying to integrate it with Arquillian.

      I was not able to find a suitable sample project explaining the use Arquillium Spring Extension in this link https://github.com/arquillian/arquillian-showcase/tree/master/spring

      Most of the example involve testing business logic by creating JAR.

      In this link https://github.com/arquillian/arquillian-extension-spring I found how to use Arquillian Spring Extension for testing web apps but not an example.

       

      So here is what I am trying to do.

      I have web archive generated for the project and it is getting deployed successfully on Wildfly without any issues or errors and we are able to access our webpage.

       

      We added arquillian configuration for project, Initially we just plan to inject entity manager and perform the testing of DAO access layer. But we thought that we have completely deployable WAR , so lets setup arquillian for entire testing and not for just DAO layer. Hence we decided to configure the same.

       

      Now I am not creating entire WAR again , but using the exisiting one with no change in any config file . (I know persistence-ds should be changed and used accordingly, but that can be done later using maven). So currently all my config files (applicationContext, beans.xml, hibernate.xml, web.xml, mappings.xml ... etc ) are all same as used in DEV env.

       

      So here is list of the files,

      1. Error,  (Maven -X) , sysout of WebArchive Structure  -

      https://gist.github.com/shrikanthavale/ad4cc4015c53c98b64a2

      2. POM.xml

      https://gist.github.com/shrikanthavale/8cd19f2a6c3be8cc44be

      3. Test Case

      https://gist.github.com/shrikanthavale/b72e8c8348354db4d0c3

      4. Config Files - Web.xml, ApplicationContext.xml, hibernate,xml, beans.xml, faces-config, mvc-dispatcherservlet, mappings.xml

      https://gist.github.com/shrikanthavale/273890d1cf844f28adc9

       

      Can someone please help me out here, Also currently in Test case u won't see much testing logic, For time being I am just trying to inject entity manager and DAO layer

       

      Next Options I can try are,

      Not to use war directly but to create one using ShrinkWrap by adding packages and dependencies and so on.... I don't know if this is really necessary.

      Other option, I can separate out logic code from view and create a JAR and then use @SpringConfiguration , and see if it works.

      Or drop Spring Extension and use plain CDI and see if it works, but when it will come to Spring MVC testing I might have to solve this issue.

       

      Thank you in advance.