2 Replies Latest reply on Mar 13, 2014 10:51 AM by cristianmiranda

    Errai testing issue with multimodule project

    cristianmiranda

      Hi guys,

       

           csa, we talked about this in the errai IRC channel.

           I’m stucked with the models project (external module) inheritance in our App.gwt.xml module. I’ve created a test like this:

       

      package app.client.ui;
      import app.client.local.Dashboard;
      import org.jboss.errai.bus.client.tests.AbstractErraiTest;
      public class RPCClientTest extends AbstractErraiTest {
      private Dashboard dashboard;
        @Override
        public String getModuleName() {
             return "app.App";
        }
        @Override
        protected void gwtSetUp() throws Exception {
             super.gwtSetUp();
        }
        public void testSendMessage() throws Exception {
             assertNull(null);
        }
      }
      
      

       

           Basically, when I add the Dashboard page in it like I’m doing in the fifth line and run the tests like this:

      mvn clean test -Ptestui -Denvironment=dev

       

      … it fails and throw me these errors: http://pastebin.com/An8zeYGG

       

           Here is the pom.xml: http://pastebin.com/vpe8XS5f

           Here is App.gwt.xml: http://pastebin.com/UL1NaNBa

           Here is Models.gwt.xml: http://pastebin.com/S4YAzm6P

           Here is Entities.gwt.xml: http://pastebin.com/dDs4LzP7

       

           Here is the models project structure (all the model classes are inside models/shared)

      Screen Shot 2014-03-12 at 11.05.13.png

       

           I’ve tried the following in order to fix this:

       

      Changes in App.gwt.xml & Models.gwt.xml

      • Making Models.gwt.xml the only module in models project (to avoid transitive inheritance)

      • Adding sources explicitly in App.gwt.xml

        This is adding the following:

        <source path='shared’/>
        <source path='validation’/>

        … but then it complains about not knowing the test (only failure). Fixing that by adding

        <source path=‘client’/>

        … and we’re back with the same models errors as before.

      • Inheriting com.magick.models.Entities in App.gwt.xml (to avoid transitive inheritance)

      Changes in pom.xml

           We have a profile named “testui” for running this tests.
      • Changed maven surfire plugin to maven gwt plugin to run the tests

      • Moved test from the current package to see if there was a problem with cyclic dependencies

      • Added -Dorg.jboss.errai.bus.do_long_poll=false as Errai documentation recommends in order to make the tests succeed (It has nothing to do with the models
         
      I’m creating the tests following this sample project: http://docs.jboss.org/errai/2.4.0.Beta1/errai/quickstart/html_single/#sid-9470155

       

      Any help will be appreciated.

      Let me know if you have any questions.

       

      Kindest Regards,

        • 1. Re: Errai testing issue with multimodule project
          mbarkley

          Does your models project package source files? If not, you need to have the source files from the models project on the classpath when you run the tests.

          1 of 1 people found this helpful
          • 2. Re: Errai testing issue with multimodule project
            cristianmiranda

            I had to add the following in my pom.xml (in addition to the dependency to models project)

             

                    <dependency>

                        <groupId>com.magick</groupId>

                        <artifactId>models</artifactId>

                        <version>0.2.0-Final</version>

                        <classifier>sources</classifier>

                        <scope>provided</scope>

                    </dependency>

             

            Thanks you guys!