I was just discussing this on the #gwt IRC channel and tieTYT gave a good suggestion for getting around these static methods. Just create a wrapper class which you can then mock out in a unit test. Sounds like it should work :)
> Mind? Heck no! That would be great! Sorry Bruce, being killed by a current project. I'll write something up soon. -- Arthur Kalmenson On Wed, Feb 18, 2009 at 6:34 PM, Bruce Johnson <[email protected]> wrote: > Mind? Heck no! That would be great! > On Wed, Feb 18, 2009 at 5:21 PM, Arthur Kalmenson <[email protected]> > wrote: >> >> Hello everyone, >> >> I have a fairly complex class that is almost entirely non-GWT specific >> aside from a single line that uses GWT's URL.decodeComponent method. >> While I rediscovered GWTMockUtilities and found EasyMock Class >> extension, I still can't think of any way to mock out the URL class. >> This is because the object is not instantiable (it's final) and it's a >> static method call. >> >> I'm not sure if there's some performance reason behind making it a >> final class and using static methods, but it does make testing a pain. >> It forces me to use GWTTestCase instead of TestNG to test that >> particular class because of the single line of code. >> >> P.S. Does anyone mind if I write a little guide in the GWT Group about >> using GWTMockUtilities with EasyMock? >> >> -- >> Arthur Kalmenson >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
