Re: Gwt RF and Junit - did you forget to inherit a required module
You're trying to test your RF setup using RequestFactorySource+InProcessRequestProcessor yet you're running it as a GWTTestCase.
Either you use "VM code" and this is a pure JUnit test, or you use only "client" code and you use a GWTTestCase.
You can mix things only in a single way: have your GWTTestCase return 'null' from getModuleName() so it's run like a pure JUnit test; this is helpful when you want to run the same set of tests in both modes (RequestFactorySource and GWT.create()): create a GWTTestCase with only "client" code and make sure you put the GWT.create() code in an overrideable method, then create another test inheriting the previous class and overriding the RF creation to use RequestFactorySource and getModuleName to return 'null'. This is used quite a few times in GWT proper.
Also note that GWTTestCase is JUnit 3, so you cannot use @Test or @Before, you have to use the naming conventions instead.
On Friday, July 12, 2013 4:43:05 PM UTC+2, aurelie...@gmail.com wrote:
-- On Friday, July 12, 2013 4:43:05 PM UTC+2, aurelie...@gmail.com wrote:
Hi There,
Trying to understand how i could use Junit with my gwt rf project ( Using maven )
I'm using this link
After running a gwt test junit, i have the following error.
My first intention could be to add an inherit line somewhere in a .xml file. But what exactly and which one ?
mvtJUnit.gwt.xml or project.xml ?
I tried by adding a requestfactory-server dependency on pom.xml but obviously, i misunderstood sth important.
May i have a help on this ?
[INFO] Running junit.framework.TestSuite@7e3bfb66
[INFO] DEBUG 12/07/2013 16:20:21 [JspRuntimeContext.java.<init>(104)] Le chargeur de classe parent (class loader) est: ContextLoader@null
[INFO] DEBUG 12/07/2013 16:20:21 [JspServlet.java.init(80)] Le répertoire de travail (scratch dir) pour le moteur de JSP est: D:\TEMP\Jetty_0_0_0_0_0_www-test____-7lfhqt\jsp
[INFO] DEBUG 12/07/2013 16:20:21 [JspServlet.java.init(82)] IMPORTANT: Ne pas modifier les servlets générées
[INFO] [ERROR] Errors in 'file:/D:/path/src/test/java/com/test/client/GwtTestmvt. java'
[INFO] [ERROR] Line 27: No source code is available for type com.test.persistance.dao.IMvtEnteteDAO; did you forget to inherit a required module?
[INFO] [ERROR] Line 28: No source code is available for type com.test.server.CEMMvt; did you forget to inherit a required module?
[INFO] [ERROR] Line 59: No source code is available for type com.google.web.bindery.requestfactory.server. ServiceLayer; did you forget to inherit a required module?
[INFO] [ERROR] Line 60: No source code is available for type com.google.web.bindery.requestfactory.server. SimpleRequestProcessor; did you forget to inherit a required module?
[INFO] [ERROR] Line 61: No source code is available for type com.google.web.bindery.requestfactory.vm. RequestFactorySource; did you forget to inherit a required module?
[INFO] [ERROR] Line 62: No source code is available for type com.google.web.bindery.requestfactory.server.testing. InProcessRequestTransport; did you forget to inherit a required module?
Here are the following import i have within the test class.import org.junit.Before;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.web.bindery.event.shared.SimpleEventBus;
import com.google.web.bindery.requestfactory.server. ServiceLayer;
import com.google.web.bindery.requestfactory.server. SimpleRequestProcessor;
import com.google.web.bindery.requestfactory.server.testing. InProcessRequestTransport;
import com.google.web.bindery.requestfactory.shared. RequestFactory;
import com.google.web.bindery.requestfactory.vm. RequestFactorySource;
import com.test.persistance.dao.IMvtEnteteDAO;
import com.test.server.CEMMvt;
Regards,
pierre
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home