GWT Test

16 views
Skip to first unread message

fabiof...@gmail.com

unread,
Oct 10, 2008, 7:18:09 AM10/10/08
to Google Web Toolkit
Hello,
could anybody post me some tutorial to create gwt test case. I have
tried with many example, but I don't Understand what are the steps to
do.
I want to test one presenter in my application, so I have created an
TestCase class which extend GwtTestCase, but when I try to execute
this code, the compiler answer with

java.lang.OutOfMemoryError: Java heap space
at java.util.zip.InflaterInputStream.<init>(Unknown Source)
at java.util.zip.ZipFile$1.<init>(Unknown Source)
at java.util.zip.ZipFile.getInputStream(Unknown Source)
at java.util.zip.ZipFile.getInputStream(Unknown Source)
at java.util.jar.JarFile.getBytes(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at junit.framework.TestResult.addError(TestResult.java:36)
at junit.framework.TestResult.runProtected(TestResult.java:137)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:132)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:
76)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)

Ponthiaux Eric

unread,
Oct 10, 2008, 9:03:02 AM10/10/08
to Google-We...@googlegroups.com
Try to increase the java maximum heap size ( -Xmx ) and the initial heap
size ( -Xms ) .

regards .

fabiof...@gmail.com a écrit :

Sumit Chandel

unread,
Oct 15, 2008, 2:00:13 PM10/15/08
to Google-We...@googlegroups.com
Hi Fabio,

We realized that our JUnit testing documentation was sorely lacking prior to 1.5, and so have included more details about writing test cases for GWT applications in our new GWT 1.5 documentation. You can check it out at the link below.

GWT 1.5 Unit Testing docs:

As for the exception you received when trying to run the unit test, Eric's suggestion to increase the maximum heap size should work.

Hope that helps,
-Sumit Chandel

Sumit Chandel

unread,
Apr 16, 2009, 8:14:09 PM4/16/09
to Google-We...@googlegroups.com, Janusz Prokulewicz
Hi Janusz,

Some developers have been experiencing issues with this because the compiler is simply using too much stack space. We're working on fixing that in Issue #3510. In fact, Scott recently attached a patched gwt-dev jar to the issue report that has successfully solved the stack problem for at least some developers. Give it a try and let us know if it fixes your issue as well.

Issue #3510:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3510

I've also read some comments that switching to JDK 6 has been getting some developers back into the groove as well, so if the patched dev jar doesn't work, you might want to give that a try as a temporary workaround for now.

Hope that helps,
-Sumit Chandel

2009/4/16 Janusz Prokulewicz <jproku...@gmail.com>
Hi,

unfortunately I  have the same problem and even adding both
parameters: -Xmx512M and -Xms512M doesn't change situation. Does
anybody know any other reason that can cause it ?

Thanks in advance,
Janusz Prokulewicz


On 15 Paź 2008, 20:00, "Sumit Chandel" <sumitchan...@google.com>

wrote:
> Hi Fabio,
> We realized that our JUnit testing documentation was sorely lacking prior to
> 1.5, and so have included more details about writing test cases for GWT
> applications in our new GWT 1.5 documentation. You can check it out at the
> link below.
>

>
> As for the exception you received when trying to run the unit test, Eric's
> suggestion to increase the maximum heap size should work.
>
> Hope that helps,
> -Sumit Chandel
>
> On Fri, Oct 10, 2008 at 4:18 AM, fabiofumar...@gmail.com <

Janusz Prokulewicz

unread,
Apr 17, 2009, 6:16:08 AM4/17/09
to Google Web Toolkit
Hi,

thanks for quick answer.

Just before I get message from you I figured out how to solve this
problem. It was something with my classpath - I think I pointed too
much unecessary jars and classes. When I add only required files to my
classpath it works fine. Attaching gwt-dev-patch.jar doesn't seem to
change anything in my case.

Thanks anyway, GWT rocks :)


Greetings,
Janusz Prokulewicz


On 17 Kwi, 02:14, Sumit Chandel <sumitchan...@google.com> wrote:
> Hi Janusz,
>
> Some developers have been experiencing issues with this because the compiler
> is simply using too much stack space. We're working on fixing that in Issue
> #3510. In fact, Scott recently attached a patched gwt-dev jar to the issue
> report that has successfully solved the stack problem for at least some
> developers. Give it a try and let us know if it fixes your issue as well.
>
> Issue #3510:http://code.google.com/p/google-web-toolkit/issues/detail?id=3510
>
> I've also read some comments that switching to JDK 6 has been getting some
> developers back into the groove as well, so if the patched dev jar doesn't
> work, you might want to give that a try as a temporary workaround for now.
>
> Hope that helps,
> -Sumit Chandel
>
> 2009/4/16 Janusz Prokulewicz <jprokulew...@gmail.com>
Reply all
Reply to author
Forward
0 new messages