GWTTestCase + Spring

29 views
Skip to first unread message

dadodev

unread,
Nov 13, 2009, 2:28:40 PM11/13/09
to Google Web Toolkit
I'm working on a GWT (1.7) application that uses Spring and Hibernate
on the server side that is secured with SpringSecurity and CAS.
I want to create some client side tests using GWTTestCase to test the
UI and Asynch behavior of the application.

I have two problems/questions regarding GWTTestCase:
1) is it possible to customize the web.xml used by the GWT shell
started by GWTTestCase? If yes, how? I need to customize the web.xml
used by GWTTestCase to disable the application security mechanism in
my tests, otherwise I cannot call the remote services which are
secured.
2) it's my understanding that the code I write for a GWTTestCase is
like GWT client code, ie. I cannot use non-serializable classes: am I
correct? If I'm wrong, is there a way to get to the Spring context in
a GWTTestCase?

Thanks

Davis Ford

unread,
Nov 16, 2009, 8:44:17 AM11/16/09
to google-we...@googlegroups.com
Hi, I personally wouldn't write too many test cases like this unless you are just trying to ensure that everything is wired together.  Even then, I'd probably use something like Selenium to record the test from the UI and play it back.

Alternatively, you might consider employing the MVP pattern.  This would allow you to test all of your UI logic in standard JUnit, leaving just the dumb GUI display code untested.  You could choose to test the latter with a GWTTestCase if you desired.  Once I started doing this, I stopped using GWTTestCase altogether.  I unit test all my UI logic with just JUnit and EasyMock.  My tests (500+) finish in about 20 s.   


--

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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.





--
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977

Carlos Rafael Ramirez

unread,
Nov 24, 2009, 12:58:13 PM11/24/09
to google-we...@googlegroups.com
Hello,

I think GWTTesCAse use the same mechanism than Hosted mode. So you can modify the web.xml used by hosted mode. Make the hosted mode run without the security and hopefully it will work qith GWTTestCase as well.

Regards,
Carlos
Reply all
Reply to author
Forward
0 new messages