I'm working on a GWT application, and I'm trying to write tests both
for the client part (using GWTTestCase) and for the server part (using
"normal" JUnit).
The server part have the usual issues you can find in testing (use or
not the database, create a suitable environment for the testing, and
so on).
The client part, instead, gives us many problem, because of:
- speed;
- consumption of memory;
The speed of the tests is indeed a problem, even though we could put
up with it, if we were able to resolve the problem of the consumption
of memory. Indeed, we're unable to run all our tests. When we arrive
at (more or less) 90 tests run, Eclipse runs out of memory.
Is there anyone who can provide suggestions on this topic?
Regards
Marco
Hi Sumit, thanks for your answers.
> Sorry to hear that you've run into this problem. Here are a couple of
> things I suggest to try and improve the situation and get your tests up and
> running.
>
> 1) Use Test Suites, if possible. As long as your test cases are in the
> same GWT module, executing a test suite that includes those cases rather
> than each test case individually has been known to drastically increase
> execution speed as well as reduce memory consumption. If you haven't
> already done this, give it a try and it should make for better results.
No, we didn't use Test Suites. I've just run a small benchmark,
running tests (152) both with suites and with a configuration in
Eclipse which runs all tests inside a package. Results are of the same
order of magnitude (140 secs).
I'm not sure there can be much space for improvement, also because a
number of tests, strictly speaking, are not unit tests, but more
integration tests (therefore, they do talk with database, etc. etc.).
> 2) Try passing in the -Xmx1024 argument to allocate more memory to the
> JUnit process. From previous experience I would be able to run a set of
> test cases that would otherwise block on memory shortage by passing in this
> argument.
This actually worked! I added it to the JUnit configuration, and was
able to run all my tests.
> Hope that helps,
> -Sumit Chandel
Thanks again.
Regards
Marco
On 5 Giu, 21:49, "Sumit Chandel" <sumitchan...@google.com> wrote:
Hi Sumit, thanks for your answers.