2 Replies Latest reply on Oct 20, 2010 4:17 PM by lypheus

    Errai + GWTTestCase

    lypheus

      Are there any simple unit test examples for Errai?  I'm searching and coming up with nothing on this subject which wouldn't be a problem except I'm having a problem getting mine to behave .

       

      I took the HelloWorld example from the docs, threw it into a GWTTestCase for my project and our team is having trouble seeing a message get received off the errai bus.

       

      Source for Unit Test is here: http://pastie.org/1221736

       

      Output received is here : http://pastie.org/1221722

       

      What I find odd is that there seems to be very little in the way of examples for unit testing this library - it must be me failing to google things up here right?  I see articles about unit testing with gwttestcase and snipets of errai code in the documentation but no concrete "heres a sample unit test for errai" to get you started!

       

      I've tried added a delayTest call in there since it might just be exiting the test method before the message has a chance to be caught by the service, but no dice.

       

      Could really use a hand here folks, it really can't be this onerous to test with errai.

       

      Starting HTTP on port 0
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/C:/Users/chris/.m2/repository/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/C:/Users/chris/.m2/repository/org/slf4j/slf4j-log4j12/1.5.10/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
      log4j:WARN Please initialize the log4j system properly.
         HTTP listening on port 56543
      Loading inherited module 'fx.lifescape.lifescapetest'
         Loading inherited module 'com.allen_sauer.gwt.log.gwt-log-DEBUG'
            Loading inherited module 'com.allen_sauer.gwt.log.gwt-log-common'
               [WARN] Setting configuration property named log_pattern in com.allen_sauer.gwt.log.gwt-log-common that has not been previously defined.  This may be disallowed in the future.
      Validating newly compiled units
         [ERROR] Errors in 'file:/C:/dev/workspace-sts/lifescapeweb/src/test/java/fx/lifescape/client/mvp/presenter/ActStreamPresenterTest.java'
            [ERROR] Line 28: No source code is available for type org.easymock.EasyMock; did you forget to inherit a required module?
      Validating newly compiled units
         [ERROR] Errors in 'file:/C:/dev/workspace-sts/lifescapeweb/src/test/java/fx/lifescape/client/mvp/presenter/ActStreamPresenterTest.java'
            [ERROR] Line 28: No source code is available for type org.easymock.EasyMock; did you forget to inherit a required module?
      Module fx.lifescape.lifescapetest.JUnit has been loaded
      The development shell servlet received a request for 'proxy' in module 'fx.lifescape.lifescapetest.JUnit.gwt.xml'
         [WARN] Resource not found: proxy; (could a file be missing from the public path or a <servlet> tag misconfigured in module fx.lifescape.lifescapetest.JUnit.gwt.xml ?)
      DEBUG: Connecting Errai at URL in.erraiBus
      DEBUG: New subscription: ClientBus -> org.jboss.errai.bus.client.framework.ClientMessageBusImpl$8@7bd422a4
      DEBUG: New subscription: ClientBusErrors -> org.jboss.errai.bus.client.framework.ClientMessageBusImpl$9@81b02b8
      All clients connected (Limiting future permutations to: gecko1_8)