As far as I know, you are still bound by all the browser rules, regardless of the fact you're running in hosted mode. The hosted mode browser is still a web browser, and your code is compiled out to Javascript, so I'm pretty the compiler isn't going to behave differently in hosted mode.
Your best bet for mocking these types of things is to do it on the server where you can do all the file IO that you'd like. Then mock the REST reponse down to your regular client code. Just a quick thought. Good luck! Later, Shaffer On Mar 9, 9:28 am, mabead <[email protected]> wrote: > Hi All, > > I want to create a unit tests that mocks the XML response of a REST > service. In that unit test, I would want to read a XML file on disk > and return that instead of the actual REST response. So, in my unit > test I do: > > FileReader fileReader = new FileReader(fileName); > > Unfortunately, when I try to run the JUnit test in Eclipse, I get the > following messages: > > [ERROR] Errors in 'file:/C:/TSeries2/Main/apps/web/test/com/company/ > client/ConfigurationAccessorMock.java' > [ERROR] Line 23: No source code is available for type > java.io.FileReader; did you forget to inherit a required module? > > I understand that this code can't be used in the code running on the > client side of my final web page but I would have expected that my > unit tests would have access to the full Java libraries. > Unfortunately, it looks like it doesn't. > > Does anybody have a suggestion to be able to use the full blown Java > libraries in my unit tests? > > Regards, > Maxime --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
