How to get Resources in GWTTestCase

54 views
Skip to first unread message

Jeff Chimene

unread,
Nov 6, 2011, 7:09:10 PM11/6/11
to GWT-users-list
Hi:

I'd like to test calls to XMLParser.parse().

I'd like to use a testing framework to send various XML documents to a
class method that calls this routine.

I want to use the browser implementation to perform the parse. This
means GWTTestCase.

GWTTestCase implies no java.io

I don't want to hardcode XML documents in my test drivers. I'd like to
use GWT Resources.

GWT Resources seems to imply GWT.create() which conflicts with GWTTestCase.

I'm sure there's a way to get Gin to work with GWTTestCase.

Searching only returns example code that doesn't work and is poorly
documented (e.g.
http://howtogwt.blogspot.com/2010/03/instance-creation-and-dependency.html)

What solutions have others implemented?

TIA,
jec

Gael Lazzari

unread,
Nov 7, 2011, 3:09:38 AM11/7/11
to google-we...@googlegroups.com, GWT-users-list
Maybe you could try to implement your unit test with gwt-test-utils, which also provides support for GIN. 
You also would able to initialize your unit test with every java.io class you want, since gwt-test-utils derestricts java API use in GWT unit tests :)

Cheers,

Gael

Jeffrey Chimene

unread,
Nov 7, 2011, 8:55:51 AM11/7/11
to google-we...@googlegroups.com
Thanks, I'll try that

Best Regards,
jec
Reply all
Reply to author
Forward
0 new messages