Hi all,

Actually, GWTTestSuite is a Java helper class, not translated to
Javascript. Look at the package name : com.google.gwt.junit.tools
instead of com.google.gwt.junit.client for GWTTestCase (the last one
contains client).

Therefore, if your test suite is in the GWT compiler lookup path, GWT
compiler will try to translate it to Javascript (and will give you
error messages) but your test suite will still be launched.

As a workaround, you can put the following line in your .gwt.xml :
<source path="client" excludes="**/*TestSuite.java" />

A "cleaner" way would be to give the excludes arg at runtime and to
not pollute your module configuration, but I don't know if this is
possible.

Regards

On 24 oct, 09:41, JAWspeak <[EMAIL PROTECTED]> wrote:
> I will add my report to this as well. Seems like a bug, or oversight
> in the error logging from GWT.
>
> My test (which passes in isolation):
> public class PackagePanelTest extends GWTTestCase {
>   public String getModuleName() {
>     return "com.xyzclient.web.App";
>   }
>
>   public void testShouldMakeAllFieldsAvailableWhenPopulated() throws
> Exception {
>     Pkg pkg = new PackageBuilder("2008xxxx").build();
>     PackagePanel packagePanel = new PackagePanel();
>     packagePanel.populate(pkg);
>   }
>
> }
>
> My suite **Note how it differs from the instructions on the web. I
> create a GWTTestSuite, not a TestSuite:
>
> public class AllGwtTests extends GWTTestSuite {
>         public static Test suite() {
>                 GWTTestSuite suite = new GWTTestSuite();
>                 suite.addTestSuite(PackagePanelTest.class);
>                 return suite;
>         }
>
> }
>
> My suite passes (when run in the IDE), but it has messages such as
> this:
> Compiling Java source files in module 'com.xyzclient.web.App.JUnit'
>    Removing units with errors
>       [ERROR] Errors in 'file:/Users/admin/projects/x/pr/test-gwt/com/
> xyzclient/web/client/AllGwtTests.java'
>          [ERROR] Line 12: No source code is available for type
> com.google.gwt.junit.tools.GWTTestSuite; did you forget to inherit a
> required module?
> Rebinding com.google.gwt.junit.client.impl.GWTRunner
>    Removing units with errors
>       [ERROR] Errors in 'file:/Users/admin/projects/x/pr/test-gwt/com/
> xyzclient/web/client/AllGwtTests.java'
>          [ERROR] Line 12: No source code is available for type
> com.google.gwt.junit.tools.GWTTestSuite; did you forget to inherit a
> required module?
>
> -Jonathan
>
> On Oct 23, 1:23 pm, sean <[EMAIL PROTECTED]> wrote:
>
> > Hi Jan,
>
> > I also receive the "No source code is available for type
> > com.google.gwt.junit.tools.GWTTestSuite; did you forget to inherit a
> > required module? " message. I think this must be something GWT just
> > left out. One would think you would find the module for GWTTestSuite,
> > but it does not exist. However, the functionality still works for me
> > (all test classes get run). So the errors are thrown but don't seem to
> > matter. Kind of annoying.
>
> > On Oct 14, 4:44 am, Jan <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I created a module containing GWTTestCases as described here (I am
> > > using GWT 1.5.2 on Windows XP):
>
> > >http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...
>
> > > and here
>
> > >http://60-248-16-66.hinet-ip.hinet.net/GWT/doc/html/com.google.gwt.do...
>
> > > I have one GWTTestCase class and one GWTTestSuite class. Here is the
> > > code:
>
> > > 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> > > package test.client;
>
> > > import junit.framework.Test;
> > > import junit.framework.TestSuite;
>
> > > import com.google.gwt.junit.tools.GWTTestSuite;
>
> > > public class TestTestSuite extends GWTTestSuite {
>
> > >         public static Test suite() {
> > >                 TestSuite suite = new TestSuite("Tests");
> > >                 suite.addTestSuite(TestTest.class);
> > >                 return suite;
> > >         }
>
> > > }
>
> > > ---
>
> > > package test.client;
>
> > > import com.google.gwt.junit.client.GWTTestCase;
>
> > > public class TestTest extends GWTTestCase {
>
> > >         @Override
> > >         public String getModuleName() {
> > >                 return "test.Test";
> > >         }
>
> > >         public void testStuff() {
> > >                 assertTrue(2 + 2 == 4);
> > >         }
>
> > > }
> > > >8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> > > And here is the Module xml:
>
> > > <module>
>
> > >     <inherits name='com.google.gwt.junit.JUnit'/>
>
> > > </module>
>
> > > Invoking the test case using the following command line works:
>
> > > @java -Dgwt.args="-out www-test" -Xmx256M -cp ".\src;.\bin;.\lib
> > > \junit.jar;.\lib\gwt-user.jar;.\lib\gwt-dev-windows.jar"
> > > junit.textui.TestRunner test.client.TestTest %*
>
> > > Invoking the TestTestSuite using the following command line:
>
> > > @java -Dgwt.args="-out www-test" -Xmx256M -cp ".\src;.\bin;.\lib
> > > \junit.jar;.\lib\gwt-user.jar;.\lib\gwt-dev-windows.jar"
> > > junit.textui.TestRunner test.client.TestTestSuite %*
>
> > > fails with the error message:
>
> > > Error: java.lang.ClassCastException: class test.client.TestTestSuite
>
> > > I checked the class path several times. All src folders and jars are
> > > present.
>
> > > I played around with the code a bit. Letting the TestTestSuite class
> > > inherit from GWTTestCase works (to some extend). Here is the changed
> > > code:
>
> > > package test.client;
>
> > > import junit.framework.Test;
>
> > > import com.google.gwt.junit.client.GWTTestCase;
> > > import com.google.gwt.junit.tools.GWTTestSuite;
>
> > > public class TestTestSuite extends GWTTestCase {
>
> > >         [EMAIL PROTECTED]
> > >         public String getModuleName() {
> > >                 return "test.Test";
> > >         }
>
> > >         public static Test suite() {
> > >                 GWTTestSuite suite = new GWTTestSuite("Tests");
> > >                 suite.addTestSuite(TestTest.class);
> > >                 return suite;
> > >         }
>
> > > }
>
> > > Now the test case is run. However, the GWT compiler complains with
> > > some error messages:
>
> > > Removing units with errors
> > >    [ERROR] Errors in 'file:/<path goes here>/src/test/client/
> > > TestTestSuite.java'
> > >       [ERROR] Line 17: No source code is available for type
> > > com.google.gwt.junit.tools.GWTTestSuite; did you forget to inherit a
> > > required module?
>
> > > I have no idea which module could be missing.
>
> > > Any ideas from the GWT experts?
>
> > > Cheers,
>
> > > Jan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to