Re: Poll: unit tests source code layout / GWTTestCase vs. EasyMock

2009-09-15 Thread Daniel Wellman

We chose #3 - two separate source folders for tests and GWTTestCases.
This also meant that we could easily run all the fast tests when we
wanted quick feedback about a change.

If you wanted to remove the need for the GWTTestCase, could you create
an interface that wraps the History object?  I don't know enough about
how your code works, but perhaps you could inject a mock
implementation of the History object and ensure that it gets invoked
with the right state; in your example it looks like it wants to be
notified with the token test.  However, if there's other stuff going
on in that method, then this approach might not work.

Dan

On Sep 14, 5:29 am, Thomas Broyer t.bro...@gmail.com wrote:
 [Ray, I'm CC'ing you because I believe you have an opinion/answer on
 the matter]

 Hi all,

 Here's dilemma I believe many of us are facing, namely how to organize
 the source code of unit tests when you have both GWTTestCase and pure
 java JUnit tests using EasyMock (or any other mocking lib).

 The problem:
 I place my unit tests in the same package as the classes under test
 (that's common practice, and it helps for some tests to have package-
 scope methods on your class-under-test); this means that I might have
 in the same package (or within subpackages of the same *.client
 package) both GWTTestCase and pure-JUnit tests using EasyMock.
 That's not really a problem, tests run OK, *but* because they're all
 in the 'client' source path of the same GWT module, I have warnings
 when the GWTTestCase's run (when GWT compiles the module; it finds the
 EasyMock classes and signals that it cannot find the source code so it
 discards it and the JUnit test). Again, this is only just warnings,
 because the JUnit tests using EasyMock won't be run by GWT (so the
 optimization phase would have discarded them).
 But I find those warnings a bit annoying; distracting at best.

 So here's my question: what are you doing in your projects?

 And here are possible answers:
 1. just ignore the warnings; only pay attention to the tests success/
 failures
 2. use a super-source/ with dummy EasyMock implementations (it works
 very well, all methods throwing UnsupportedOperationException, just in
 case)
 3. separate the tests into two source branches (instead of src/...
 and test/... as you can see in GWT for instance, use src/..., test/...
 and gwt-test/...) and do not include pure-JUnit tests when running GWT
 tests (this means running GWTTestCase and pure-JUnit tests separately,
 in two runs of JUnit)
 4. use a naming convention (MyClassJavaTest vs. MyClassGwtTest) and
 use a source path=client exclude=**/*JavaTest.java / (tested,
 works very well too)
 5. Another approach, please detail!

 Here's an (adapted) excerpt from my code (note: I'm using JUnit 4
 here, but that doesn't change much thing to the issue, except that
 you'll have warnings with JUnit 4's classes too). You'll see how I
 test the same class using both EasyMock (for the major part) and
 GWTTestCase (when I hardly have the choice).

 package com.atolcd.gwt.place.client;
 ...
 public class PlaceManagerImpl {
   �...@inject
    public PlaceManagerImpl(EventBus eventBus) {
       ...
       if (GWT.isClient()) {
          History.addValueChangeHandler(new ValueChangeHandlerString
 () {
             public void onValueChange(ValueChangeEventString event)
 {
                onHistoryChange(event.getValue());
             }
          });
       }
    }
    ...
    /* package */void onHistoryChange(String newToken) {
       ...
    }}

 ...
 package com.atolcd.gwt.place.client;
 ...
 public class PlaceManagerImplJavaTest {
   �...@test
    public void testFiresPlaceChangeEventOnHistoryChange() {
       EventBus bus = createMock(EventBus.class);
       ...
       replay(bus);

       PlaceManagerImpl pm = new PlaceManagerImpl(bus);
       ...
       // simulates an history change
       pm.onHistoryChange(test);
       ...
       verify(bus);
    }}

 ...
 package com.atolcd.gwt.place.client;
 ...
 public class PlaceManagerImplGwtTest extends GWTTestCase {
   �...@override
    public String getModuleName() {
       return com.atolcd.gwt.place.Place;
    }

    public void testHistoryIsBeingUpdatedOnPlaceChange() {
       ...
       assertEquals(test, History.getToken());
    }

 }
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: gwtSetup is not executed

2009-08-05 Thread Daniel Wellman

No worries, sometimes it just takes another pair of eyes to catch the
problem!

Dan

On Aug 4, 4:27 pm, Art art...@gmail.com wrote:
 Thanks Daniel for pointing out.
 It was stupid careless simple mistake. Feel shame to bother everyone.
 Sorry.
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: gwtSetup is not executed

2009-08-04 Thread Daniel Wellman

It looks like your method's capitalization is wrong - you want your
method to be called gwtSetUp (with a capital 'u').  If you are using
Java 5 or 6 then using an @Override annotation would have given you a
compiler error, since your gwtSetup method did not override getSetUp.

Dan


On Aug 3, 9:08 pm, Art art...@gmail.com wrote:
 By overriding the gwtSetup method (http://google-web-
 toolkit.googlecode.com/svn/javadoc/1.6/index.html?overview-
 summary.html), I tried to do prep before each test execution. However,
 gwtSetup has never been executed before test execution.
 I feel strange that I could not to find any discussion about such
 simple issue anywhere. Is this happening only me?

 Here's the simple test case as an example:
 package com.appspot.inetools.newsfetcher.client;

 import com.google.gwt.junit.client.GWTTestCase;

 /**
  * GWT JUnit tests must extend GWTTestCase.
  */
 public class ValidaterExecuterTest extends GWTTestCase {

   /**
    * Must refer to a valid module that sources this class.
    */
   public String getModuleName() {
     return com.appspot.inetools.newsfetcher.NewsFetcher;
   }

   protected boolean gwtSetupFlag = false;
   protected void gwtSetup() throws Exception {
           super.gwtSetUp();
           gwtSetupFlag = true;
           //fail( gwtSetup has been called);
   }

   /**
    * Add as many tests as you like.
    */
   public void testSimple() {
     assertTrue( gwtSetupFlag);
   }

 }

 I launch that test by ValidaterExecuterTest-hosted.launch file on
 Eclipse (Galileo or Ganymede).
 Expected it to pass, but it fails.

 Environment info:
 x86 XP SP 3
 eclipse.buildId=I20090611-1540
 (Repro on Ganymede too)
 java.version=1.6.0_13
 java.vendor=Sun Microsystems Inc.
 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
 Framework arguments:  -product org.eclipse.epp.package.jee.product
 Command-line arguments:  -os win32 -ws win32 -arch x86 -product
 org.eclipse.epp.package.jee.product
 GWT 1.7.0
 JUnit3: plugins\org.junit_3.8.2.v20090203-1005\junit.jar

 I have been currently working around by putting initialization method
 at the beginning of each tests. It's tedious. I like to avoid it. If
 someone can provide any info about this issue, I highly appreciate it.

 Regards
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Automated JUnit Tests for GWT

2009-08-02 Thread Daniel Wellman

I don't know of a way to do this in Eclipse only - I'm not sure that
it's possible.

You mention that you don't want to complicate the project - for what
it's worth, Ant and Maven are two mainstream Java tools that most
developers have seen or used (especially Ant).  While they do add some
complexity, you get the benefit of being able to build your product
from anywhere, regardless of what IDE you have installed on that
machine.  Even if it's just you on the project, there's some value to
being able to build the application on a different machine -- for
example, to make sure that you've remembered to check in every file in
to your version control system, and to make sure you can build the
product for production on any computer at a moment's notice.

Dan

On Aug 2, 6:56 am, Ben2008 umi...@googlemail.com wrote:
 Is there anyway to do this with eclipse only?
 I do not want to have too much other stuff that will only complicate
 my project ...
 Best way is possibly to define a compile or build configuration in
 eclipse that will serve my needs.
 IF i click on that GWT compiler, just compile and run my test suite
 thats all i want to have.
 Maybe there is a chance to invoke the testsuite as soon as my server
 starts up ...
 for example if i run in hosted mode, my method xyz will be invoked and
 that method will start up that Junit Tests ...
 But i dont know how to start them manually.

 Thanks for any help mates

 On Aug 1, 7:24 pm, Daniel Wellman etl...@gmail.com wrote:

  Are you using Ant or Maven?

  The Maven plugin (from Codehaus) has documentation on running tests
  here:http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html

  For Ant, you'll run your tests using the standard JUnit task, but make
  sure to include your test and project source in the classpath,
  otherwise you'll get errors that code couldn't be found at test
  runtime.  And as you mentioned, you'll need to compile your test code
  first before running the JUnit task.

  Dan

  On Jul 30, 3:23 pm, Ben2008 umi...@googlemail.com wrote:

   Hi folks,
   onhttp://code.google.com/webtoolkit/doc/1.6/DevGuideTesting.html

   When developing a large project, a good practice is to integrate the
   running of your test cases with your regular build process. When you
   build manually, such as using ant from the command line or using your
   desktop IDE, this is as simple as just adding the invocation of JUnit
   into your regular build process. When building in a server
   environment, there are a few extra considerations.

   But i did not find any advice on the net how to implement automated
   tests.
   I use Eclipse 3.4 and Gwt 1.7 and my GreetTestCase works finde for
   Client und Remote Testing.
   How can i add this test to my build process? Like Compiling Project?- 
   Hide quoted text -

  - Show quoted text -


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Automatic Testing

2009-07-21 Thread Daniel Wellman

Joakim,

Either tool should work.  If you try out Selenium, you'll need to try
out the Selenium RC version, which lets you write your tests in Java,
Ruby, Python, etc.  WebDriver lets you write your tests in Java.

I'd probably use WebDriver if I had to start a new project today -
parts of it are getting merged into the next version of Selenium.
http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html

Since you'll be writing your tests in a programming language like
Java, you can do whatever you want with input XML files, but it will
be up to you to parse the files just like you would in any other
program.

As for ensureDebugId, the JavaDoc for UIObject has some documentation
about how to use it.
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(java.lang.String)

Good luck!

On Jul 21, 4:22 am, Joakim Sjöberg joakim.sjob...@artificial-
solutions.com wrote:
 Hello Dan!

 Thanks for the answer! I think that right now what we need is a simple 
 end-to-end smoke test. Witch of WebDriver or
 Selenium would you think is the best way to go? Do you know if any of them 
 have the possibilities of getting
 an xml file with data to enter during the testing to run the test with?

 How does the ensureDebugId work? Is that something you add in your GWT 
 application?

 Many question :)

 Hope to get some answers :)

 // Joakim

 -Original Message-
 From: Google-Web-Toolkit@googlegroups.com 
 [mailto:google-web-tool...@googlegroups.com] On Behalf Of Daniel Wellman
 Sent: Monday, July 20, 2009 1:20 PM
 To: Google Web Toolkit
 Subject: Re: Automatic Testing

 If you're looking to write unit or integration tests for GWT client
 code, I've written an article about my experiences here:
 Google Web Toolkit: Writing Ajax Applications 
 Test-Firsthttp://blog.danielwellman.com/2008/11/test-first-gwt-article-in-novem...

 If you've finished your application and want to add simple end-to-end
 smoke tests, you might want to consider using WebDriver or Selenium.
 To add temporary DOM IDs which only appear for testing (which will
 make writing those WebDriver or Selenium tests easier), consider using
 the method on UIObject called ensureDebugId:

 http://tinyurl.com/mdwyky
 orhttp://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...

 Dan

 On Jul 20, 5:38 am, Joakim Sjöberg joakim.sjob...@artificial-
 solutions.com wrote:
  Hello!

  I have a question that you might be able to answer. We are developing a GWT 
  application and would like some form of Automatic testing of the

  GWT application. Is there any good way to do this? Could someone please 
  point me in the right direction?

  Regards

  Joakim Sjöberg
  Developer
  Artificial Solutions Scandinavia AB


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Automatic Testing

2009-07-20 Thread Daniel Wellman

If you're looking to write unit or integration tests for GWT client
code, I've written an article about my experiences here:
Google Web Toolkit: Writing Ajax Applications Test-First
http://blog.danielwellman.com/2008/11/test-first-gwt-article-in-november-2008-better-software-magazine.html

If you've finished your application and want to add simple end-to-end
smoke tests, you might want to consider using WebDriver or Selenium.
To add temporary DOM IDs which only appear for testing (which will
make writing those WebDriver or Selenium tests easier), consider using
the method on UIObject called ensureDebugId:

http://tinyurl.com/mdwyky
or
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/UIObject.html#ensureDebugId%28com.google.gwt.dom.client.Element,%20java.lang.String%29

Dan


On Jul 20, 5:38 am, Joakim Sjöberg joakim.sjob...@artificial-
solutions.com wrote:
 Hello!

 I have a question that you might be able to answer. We are developing a GWT 
 application and would like some form of Automatic testing of the

 GWT application. Is there any good way to do this? Could someone please point 
 me in the right direction?

 Regards

 Joakim Sjöberg
 Developer
 Artificial Solutions Scandinavia AB
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Convert a java project into a web project

2009-07-16 Thread Daniel Wellman

It depends.  What kind of application do you have now?  Does it have a
desktop GUI?

Generally speaking you cannot simply use GWT to convert an existing
project as-is into a web application.  You'll need to use GWT to write
a new user interface layer and determine what code should run on the
browser and what should run on the server.  Plus, since GWT provides a
subset of all the classes provided in the Java standard libraries, and
doesn't support reflection, some Java code and libraries won't work in
GWT (such as Apache Commons BeanUtils, which uses reflection).

The best way to answer your question might be to walk through the
Getting Started Tutorial on the GWT page; it's well-written and will
take you through all the basic steps of building a GWT web
application.  It will show you what GWT code looks like and how the
user interface works with the server-side code.  Once you've followed
that tutorial, you should have a better idea of it it will work for
your application.

Cheers,
Dan



On Jul 16, 3:43 am, Jordi jvive...@hotmail.com wrote:
 I have a java project and I want to convert it into a web project. Can
 I use GWT to do that? If I can could you tell me how?
 Thanks for your attention
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



The future of GWTTestCase (and OOPHM)

2009-07-12 Thread Daniel Wellman

With OOPHM coming in GWT 2.0, which will as I understand will no
longer require the Hosted Mode browser for running GWT applications in
Java mode, what will happen with GWTTestCases?  It sounds like
GWTTestCases still use the Hosted Mode browser in headless mode.

Is this the plan for GWT 2.0?  What's the post-2.0 plan for
GWTTestCases (if there is one this early on)?

Curious,
Dan
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: MVC question

2009-06-15 Thread Daniel Wellman

This talk from the Google I/O 2009 conference has a lot of good advice
about building GWT applications (as presented by Ray Ryan):
http://code.google.com/events/io/sessions/GoogleWebToolkitBestPractices.html

Ray advocates an alternative to Model-View-Controller called Model-
View-Presenter (MVP).  It's particularly useful for testing your
application, since most of the logic gets pulled away from the Widget
classes and instead moved onto Presenter (or Controller) classes.

I've written up an article which describes how I have written GWT
applications using the MVP pattern.  Since the article came out, GWT
1.6 was released, which has the HandlerManager that Ray mentions -- if
I was starting an application today, I'd use that.
http://blog.danielwellman.com/2008/11/test-first-gwt-article-in-november-2008-better-software-magazine.html

Hope these resources are helpful -- there's a whole lot of information
about MVP and MVC out there.  I think above all else it's important to
experiment a little and see what works for you.  I know when I started
I got overwhelmed by all the various different definitions -- it's
best to pick one and try it for a bit and see what makes sense for
your application.

Cheers,
dan
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: how to easily plug-in a mock remote service

2009-03-27 Thread Daniel Wellman

Would this help?

Mocking GWT Asynchronous Services (with JMock)
http://www.jmock.org/gwt.html

Note that this example doesn't even require a GWTTestCase, which means
your tests will run much faster, but you won't get any of the
JavaScript support offered by hosted mode.  This might require
restructuring your code a bit so you're not invoking any GWT library
code that uses native JavaScript (e.g. widgets) or GWT.create(), but
I've found having more of these fast tests helps keep my state of flow
while coding.  If you do have widgets in your test, you can also use
GWTMockUtilities to mock those as well - assuming they get passed in
as dependencies.

Would this work for you?

Dan

On Mar 26, 10:20 am, denis56 denis.ergashb...@gmail.com wrote:
 Hello,

 I would like to unit test my application plugging a mock remote
 service implementation. As far as I know in version 1.5 that is being
 used, hosted mode uses
 servlet path=/myService class=test.myServiceImpl /
 line in module.gwt.xml file to refer to the right servlet.

 Who knows if if there is a programmable way so that in a junit set-up
 method one could specify that another (mock) service should be used,
 without having to replace the appropriate line in xml?

 thanks.
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to do automatic testing of GWT web application

2009-02-21 Thread Daniel Wellman

Try looking at Selenium, which lets you write test scripts which can
control IE, Firefox, and Safari.

http://seleniumhq.org/

GWT 1.5 introduced a feature which made it easy to add DOM IDs for
writing browser tests with tools like Selenium, see the JavaDoc for
UIObject#ensureDebugId:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(com.google.gwt.dom.client.Element,%20java.lang.String)

Dan

On Feb 19, 9:59 am, saffaf...@gmail.com saffaf...@gmail.com wrote:
 HI!

 I have developed a complex gwt web application with gwt1.5, now I want
 to perform an automatic testing of this application for both firefox
 and IE, I am wondering that if anyone knows about any tool, or way to
 perform automatic testing for such application, which contains lot of
 form fields, and panels.

 Thanks in advance.

 BR

 Alex
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: JUnit tests for widgets

2009-01-31 Thread Daniel Wellman

Unfortunately, the event propagation system doesn't work in
GWTTestCase - so that means you can't send a click() message to a
Button and expect the registered ClickListeners to be notified.  This
means you wouldn't be able to test clicking on an Anchor in a test and
verifying any resulting behavior, even if Anchor supported such a
method - which I'm not sure it does.

I'd recommend moving all the behavior out of any anonymous
ClickListeners and put them onto a controller or presenter object,
then unit test those classes using standard JUnit test cases.  You
won't be able to verify the callbacks are wired to the correct object,
but in my experience that was easiest to check with some manual
exploratory testing, or some very basic Selenium tests to exercise the
system (without going into exhaustive scenario tests, since these were
easier to test with unit tests).

I've written about my experiences with testing GWT applications here,
if it's helpful:
http://blog.danielwellman.com/2008/11/test-first-gwt-article-in-november-2008-better-software-magazine.html

Cheers,
Dan

On Jan 30, 9:20 am, hpgabbar haru...@gmail.com wrote:
 I am using GWTTestCase only, but for elements like Anchor, i am not
 able to find a way to fire a click. on button i could do that.
 I want to know, whether GWT provides a way a programmatic equivalent
 of the user clicking the anchor. It is there for Button.

 On Jan 30, 3:23 am, danox danoxs...@gmail.com wrote:

  The GWT has a test framework that is built on JUnit. Essentially you
  create tests and you can then test your widgets as java objects in
  your test case. The GWT test case will load up hosted mode under the
  covers and run your tests in a GWT environment. A quick read over the
  GWT docs should get you 
  started:http://code.google.com/intl/da/docreader/#p=google-web-toolkit-doc-1-...

  On Jan 30, 4:10 am, GWTDeveloper haru...@gmail.com wrote:

   Hi,

   I am new to GWT. I wanted to know effective way of testing widgets
   like button, listbox, checkbox, anchor, textbox etc.
   I have created a widget factory to create these widgets and attach
   given listeners.

   when i tried writing unit tests, i was facing problems with anchor
   element's clicks. Before i jump into selenium to write these tests,
   i wanted to know the effective way of testing these widgets. I want to
   keep selenium only for testing UI Layout/styles/component placements.

   Your inputs are highly appreciated.

   Thanks.
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWTTestCase v/s Selenium

2009-01-28 Thread Daniel Wellman

I've always used Selenium directly.  You can start by using the
Selenium IDE to record the script, but for an AJAX application, you'll
need to tweak the script by hand to add the appropriate waitFor()
commands (e.g. waitForVisible, waitForElementPresent, etc.) to ensure
that your script waits for sever commands to complete, windows to
redraw, etc.

You can decide if you want the tests to run in pure Selenese (the HTML
table structure created by the Selenium IDE) or in a host language
like Java or Ruby using Selenium RC.  I prefer writing the tests in
Java or Ruby instead of Selenese because it's easy for me to edit both
GWT code and Selenium tests all from one IDE (IntelliJ, Eclipse,
etc.), and it's easier to write reusable routines in Java or Ruby than
in Selenese tables.

If you are having problems using DOM IDs, you might consider using CSS
selectors instead to locate the items you want.

Cheers,
Dan

On Jan 28, 2:24 pm, rex ruchi.malp...@gmail.com wrote:
 Yes. Exactly. The dynamic id generation is a pain. That is an obstacle
 in the test development. Does anybody know how to tackle it in
 Selenium? Also, i repeat my previous question whether to use Selenium
 alone or with another framework like 'PushToTest'?

 Thanks,
 Rex

 On Jan 28, 2:36 am, Serge bse...@bk.ru wrote:

  I see one serious problem with Selenium using: if you use GwtExt then
  all page's ids changes dynamically, so you can't use Selenium's
  scripts directly - you have to rewrite it for another methods of
  page's widgets determination (f.e. by name, by location and so on).
  If anybody know how to force GwtExt to generate ids once it would be
  good!
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Unit test: how to access an HTML page?

2009-01-25 Thread Daniel Wellman

GWTTestCase runs your test method as a special page inside an
invisible hosted mode browser.  Unfortunately, that means there's no
way to specify the HTML that should be used as part of that page.  So
your instinct was right -- you'll need to set up the code in the DOM
like demonstrated here:

http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideJUnitSetUp

If it's difficult to set up the DOM for the unit test, is there any
way to simplify what you're testing?  Does the code really need to be
tested by an automated test, or is it a good candidate for some
targeted manual testing whenever it changes?

Dan

On Jan 23, 3:22 am, Fred Janon fja...@gmail.com wrote:
 I assumed wrongly that the unit tests had access to the HTML page defined in
 the project. I am guessing the page passed to the unit test is minimal. Is
 there a way to get access to a specified HTML page?

 I am testing some code that goes through the DOM and it is easier for me to
 create an HTML page than creating the DOM structure in the setup routine of
 the unit test.

 Thanks

 Fred

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem Runnig GWTTestCase on Linux

2009-01-25 Thread Daniel Wellman

See this thread for more information on using Xvfb and/or awt.headless
mode:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/69a215220a26316/


On Jan 17, 3:24 pm, Arthur Kalmenson arthur.k...@gmail.com wrote:
 I remember having a similar problem a while back. I think I had to
 install some additional libraries to get it to work. Make sure you
 have GTK libraries installed.

 --
 Arthur Kalmenson

 On Thu, Jan 15, 2009 at 12:06 PM, gwt_newbie csde...@gmail.com wrote:

  I am trying to runGWTTestCaseon Linux but it is failing with
  following error.

  Can't load library: /home/acwguibuild/web_ui_patriots_nightly_build/
  gui/web_gui/lib/libswt-pi-gtk-3235.so

  I have gone through the forum to find solution but nothing helped so
  far. We have linux 32-bit and JVM 32-bit so no 64-bit issue here. I
  made sure I have required gwt libs for linux in the classpath.

  I really need some help to figure this out. Your reply will be highly
  appreciated.

  Thanks!!!

  The detailed error output is here:

  - message priority=info
  - ![CDATA[ Caused an ERROR
   ]]
   /message
  - message priority=info
  - ![CDATA[ Can't load library: /home/acwguibuild/
  web_ui_patriots_nightly_build/gui/web_gui/lib/libswt-pi-gtk-3235.so
   ]]
   /message
  - message priority=info
  - ![CDATA[ java.lang.UnsatisfiedLinkError: Can't load library: /home/
  acwguibuild/web_ui_patriots_nightly_build/gui/web_gui/lib/libswt-pi-
  gtk-3235.so
   ]]
   /message
  + message priority=info
  - ![CDATA[ at java.lang.ClassLoader.loadLibrary(ClassLoader.java:
  1650)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at java.lang.Runtime.load0(Runtime.java:769)
   ]]
   /message
  + message priority=info
  - ![CDATA[ at java.lang.System.load(System.java:968)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at org.eclipse.swt.internal.Library.loadLibrary
  (Library.java:132)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at org.eclipse.swt.internal.gtk.OS.clinit(OS.java:22)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at org.eclipse.swt.internal.Converter.wcsToMbcs
  (Converter.java:63)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at org.eclipse.swt.internal.Converter.wcsToMbcs
  (Converter.java:54)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at org.eclipse.swt.widgets.Display.clinit(Display.java:
  126)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at com.google.gwt.dev.GWTShell.clinit(GWTShell.java:301)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at com.google.gwt.junit.client.GWTTestCase.runTest
  (GWTTestCase.java:219)
   ]]
   /message
  - message priority=info
  - ![CDATA[ at com.google.gwt.junit.client.GWTTestCase.run
  (GWTTestCase.java:132)
   ]]
   /message

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---