Note that there are some explanatory texts on larger screens.

plurals
  1. POError when running a GWTTestCase using maven gwt plugin
    primarykey
    data
    text
    <p>I've created a test which extends GWTTestCase but I'm getting this error:</p> <pre><code>mvn integration-test gwt:test ... Running com.myproject.test.ui.GwtTestMyFirstTestCase Translatable source found in... [WARN] No source path entries; expect subsequent failures [ERROR] Unable to find type 'java.lang.Object' [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User') Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.1 sec &lt;&lt;&lt; FAILURE! </code></pre> <p>GwtTestMyFirstTestCase.java is in /src/test/java, while the GWT module is located in src/main/java. I assume this shouldn't be a problem.</p> <p>I've done everything required according to <a href="http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html" rel="noreferrer">http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html</a> and of course that my gwt module already has com.google.gwt.core.Core indirectly imported.</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.myproject&lt;/groupId&gt; &lt;artifactId&gt;main&lt;/artifactId&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;name&gt;Main Module&lt;/name&gt; &lt;properties&gt; &lt;gwt.module&gt;com.myproject.MainModule&lt;/gwt.module&gt; &lt;/properties&gt; &lt;parent&gt; &lt;groupId&gt;com.myproject&lt;/groupId&gt; &lt;artifactId&gt;app&lt;/artifactId&gt; &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt; &lt;/parent&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.myproject&lt;/groupId&gt; &lt;artifactId&gt;app-commons&lt;/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.google.gwt&lt;/groupId&gt; &lt;artifactId&gt;gwt-dev&lt;/artifactId&gt; &lt;version&gt;${gwt.version}&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;outputFile&gt;../app/src/main/webapp/WEB-INF/main.tree&lt;/outputFile&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;goals&gt; &lt;goal&gt;test&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;classesDirectory&gt; ${project.build.directory}/${project.build.finalName}/${gwt.module} &lt;/classesDirectory&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/project&gt; </code></pre> <p>Here is the test case, located in /src/test/java/com/myproject/test/ui</p> <pre><code>public class GwtTestMyFirstTestCase extends GWTTestCase { @Override public String getModuleName() { return "com.myproject.MainModule"; } public void testSomething() { } } </code></pre> <p>Here is the gwt module I'm trying to test, located in src/main/java/com/myproject/MainModule.gwt.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd"&gt; &lt;module&gt; &lt;inherits name='com.myproject.Commons' /&gt; &lt;source path="site" /&gt; &lt;source path="com.myproject.test.ui" /&gt; &lt;set-property name="gwt.suppressNonStaticFinalFieldWarnings" value="true" /&gt; &lt;entry-point class='com.myproject.site.SiteModuleEntry' /&gt; &lt;/module&gt; </code></pre> <p>Can anyone give me a hint or two about what I'm doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload